Alphanav aide nécessaire
- Brian Jester
- Beginner


- Inscription: Jan 06, 2006
- Messages: 61
- Loc: Bayonne, New Jersey USA
- Status: Offline
Salut tout le monde et bonne année !
J'ai un code de php de travail qui affiche un indice de navigation alphabétique de A à z dans le haut de mon site Web, sa conception prévue doit ouvrir dans une nouvelle fenêtre, mais maintenant je veux l'ouvrir dans la même page...j'ai trouvé un iframe ou « switch » fonctionnerait très bien, mais je n'arrive pas à le faire fonctionner à droite.
Voici ce que je veux dire, une url pour afficher la question :http://reunitemysite.com/test2/login.php
Lorsque vous cliquez sur un des liens dans le haut alphanav, les affichages de lien css ainsi que la requête mysql entraînerait l'iframe ciblée, je tiens à afficher dans l'iframe est le résultat de la requête mySQL, pas le css de bar alphanav lui-même.
index.php
Remarque : Les deux pages php ci-dessus fonctionnent très bien sauf pour le fait que les liens dans le premier bloc de code qui est la php inclus alphabet naviation (notamment az.php) le deuxième bloc de code est l'endroit où le bloc de code doit être modifié--juste sous l'élément body dans le deuxième bloc de code, mais je suis naïf quant à ce qui doit être changé.
J'ai attendu si longtemps pour une solution à cela, je n'aime pas dire combien de temps...
Je vous remercie à l'avance !
Brian
J'ai un code de php de travail qui affiche un indice de navigation alphabétique de A à z dans le haut de mon site Web, sa conception prévue doit ouvrir dans une nouvelle fenêtre, mais maintenant je veux l'ouvrir dans la même page...j'ai trouvé un iframe ou « switch » fonctionnerait très bien, mais je n'arrive pas à le faire fonctionner à droite.
Voici ce que je veux dire, une url pour afficher la question :http://reunitemysite.com/test2/login.php
Lorsque vous cliquez sur un des liens dans le haut alphanav, les affichages de lien css ainsi que la requête mysql entraînerait l'iframe ciblée, je tiens à afficher dans l'iframe est le résultat de la requête mySQL, pas le css de bar alphanav lui-même.
index.php
Code: [ Select ]
<html>
<head> <title> </title>
<meta name="viewport" content="initial-scale=1.0">
<link rel="stylesheet" type="text/css" href="css/breadcrumb.css" media="screen" charset="utf-8" />
<link rel="stylesheet" type="text/css" href="css/default.css" media="screen" charset="utf-8" />
<link rel="stylesheet" type="text/css" href="css/menu.css" media="screen" charset="utf-8" />
</head>
<body>
<?php include('az.php'); ?>
<div class="drop-shadow lifted" id="header"><img src="/test2/images/logo.png" alt="Reunite My Site - Company Logo" title="Reunite My Site - Company Logo"> </div>
<div id="login">Login: <input type="username" class="login" size="20px;">
<br />
Password: <input class="login" type="password" size="20px">
<br />
Remember Me? <input type="checkbox">
<a href="#">Register Now For Free!</a>
<div class="note orange rounded">Start your Advertising or Publishing Campaign Now by simply clicking the Register Now button above!</div></div>
<?php
if($GET['frame'] == 1) {
//This creates the menu at the top A-Z
$char = $_GET['letter'];
$list="num";
foreach (range('A', 'Z') as $i) $list.=",$i";
$list.=",Show All Ads";
$a = explode(',', $list);
foreach ($a as $b) {
if (!empty($b)) {
if ($b=="num") {
if ($char=="num") echo "<a href=\"az.php?letter=num\" target=\"target\" >#</a>";
else echo "<a href=\"az.php?letter=num\" target=\"target\">#</a>";
}
elseif ($b=="Show All Ads") {
if (($char=="*")||(empty($char))) echo "<a href=\"az.php?letter=*\" target=\"target\">Show All Ads</a>";
else echo "<a href=\"az.php?letter=*\" target=\"target\">Show All Ads</a>";
}
elseif($b==$char) echo "<a href=\"az.php?letter=".$b."\" target=\"target\">$b</a>";
else echo "<a href=\"az.php?letter=".$b."\" target=\"target\">$b</a>";
}
}
}
?>
<iframe name="frame">Sorry, you need the newest browser to display iframes!</iframe>
</body>
</html>
<head> <title> </title>
<meta name="viewport" content="initial-scale=1.0">
<link rel="stylesheet" type="text/css" href="css/breadcrumb.css" media="screen" charset="utf-8" />
<link rel="stylesheet" type="text/css" href="css/default.css" media="screen" charset="utf-8" />
<link rel="stylesheet" type="text/css" href="css/menu.css" media="screen" charset="utf-8" />
</head>
<body>
<?php include('az.php'); ?>
<div class="drop-shadow lifted" id="header"><img src="/test2/images/logo.png" alt="Reunite My Site - Company Logo" title="Reunite My Site - Company Logo"> </div>
<div id="login">Login: <input type="username" class="login" size="20px;">
<br />
Password: <input class="login" type="password" size="20px">
<br />
Remember Me? <input type="checkbox">
<a href="#">Register Now For Free!</a>
<div class="note orange rounded">Start your Advertising or Publishing Campaign Now by simply clicking the Register Now button above!</div></div>
<?php
if($GET['frame'] == 1) {
//This creates the menu at the top A-Z
$char = $_GET['letter'];
$list="num";
foreach (range('A', 'Z') as $i) $list.=",$i";
$list.=",Show All Ads";
$a = explode(',', $list);
foreach ($a as $b) {
if (!empty($b)) {
if ($b=="num") {
if ($char=="num") echo "<a href=\"az.php?letter=num\" target=\"target\" >#</a>";
else echo "<a href=\"az.php?letter=num\" target=\"target\">#</a>";
}
elseif ($b=="Show All Ads") {
if (($char=="*")||(empty($char))) echo "<a href=\"az.php?letter=*\" target=\"target\">Show All Ads</a>";
else echo "<a href=\"az.php?letter=*\" target=\"target\">Show All Ads</a>";
}
elseif($b==$char) echo "<a href=\"az.php?letter=".$b."\" target=\"target\">$b</a>";
else echo "<a href=\"az.php?letter=".$b."\" target=\"target\">$b</a>";
}
}
}
?>
<iframe name="frame">Sorry, you need the newest browser to display iframes!</iframe>
</body>
</html>
- <html>
- <head> <title> </title>
- <meta name="viewport" content="initial-scale=1.0">
- <link rel="stylesheet" type="text/css" href="css/breadcrumb.css" media="screen" charset="utf-8" />
- <link rel="stylesheet" type="text/css" href="css/default.css" media="screen" charset="utf-8" />
- <link rel="stylesheet" type="text/css" href="css/menu.css" media="screen" charset="utf-8" />
- </head>
- <body>
- <?php include('az.php'); ?>
- <div class="drop-shadow lifted" id="header"><img src="/test2/images/logo.png" alt="Reunite My Site - Company Logo" title="Reunite My Site - Company Logo"> </div>
- <div id="login">Login: <input type="username" class="login" size="20px;">
- <br />
- Password: <input class="login" type="password" size="20px">
- <br />
- Remember Me? <input type="checkbox">
- <a href="#">Register Now For Free!</a>
- <div class="note orange rounded">Start your Advertising or Publishing Campaign Now by simply clicking the Register Now button above!</div></div>
- <?php
- if($GET['frame'] == 1) {
- //This creates the menu at the top A-Z
- $char = $_GET['letter'];
- $list="num";
- foreach (range('A', 'Z') as $i) $list.=",$i";
- $list.=",Show All Ads";
- $a = explode(',', $list);
- foreach ($a as $b) {
- if (!empty($b)) {
- if ($b=="num") {
- if ($char=="num") echo "<a href=\"az.php?letter=num\" target=\"target\" >#</a>";
- else echo "<a href=\"az.php?letter=num\" target=\"target\">#</a>";
- }
- elseif ($b=="Show All Ads") {
- if (($char=="*")||(empty($char))) echo "<a href=\"az.php?letter=*\" target=\"target\">Show All Ads</a>";
- else echo "<a href=\"az.php?letter=*\" target=\"target\">Show All Ads</a>";
- }
- elseif($b==$char) echo "<a href=\"az.php?letter=".$b."\" target=\"target\">$b</a>";
- else echo "<a href=\"az.php?letter=".$b."\" target=\"target\">$b</a>";
- }
- }
- }
- ?>
- <iframe name="frame">Sorry, you need the newest browser to display iframes!</iframe>
- </body>
- </html>
Code: [ Select ]
<?php
// How many adjacent pages should be shown on each side?
$adjacents = 1; //This only applies to lists that are more then 8 pages (controls the ...'s not the list)
//how many items to show per page
$limit = 10;
//Number of ads per row
$rows = 3;
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
<title>A To Z AD Navigation </title>
<style media="screen" type="text/css">
html, body { }
#aznavbar a:link {
color: #0C7FB0;
font-family:Verdana,Geneva,'DejaVu Sans',sans-serif;
margin-left: 4.15px;
padding: 10px;
text-decoration:none;
}
#aznavbar a:visited {
color: #0C7FB0;
font-family:Verdana,Geneva,'DejaVu Sans',sans-serif;
padding: 10px;
text-decoration:none;
}
#aznavbar a:hover {
background-color: #FA6405;
color:#000;
font-family:Verdana,Geneva,'DejaVu Sans',sans-serif;
padding: 10px;
text-decoration:none;
}
#aznavbar a:active{
color:#FA6405;
font-family:Verdana,Geneva,'DejaVu Sans',sans-serif;
padding: 10px;
text-decoration:none;
}
#aznavbar {
background: #141414;
background: -moz-linear-gradient(top, #32323a 0%, #141414 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #32323a), color-stop(100%, #141414));
background: -webkit-linear-gradient(top, #32323a 0%, #141414 100%);
background: -o-linear-gradient(top, #32323a 0%, #141414 100%);
background: -ms-linear-gradient(top, #32323a 0%, #141414 100%);
background: linear-gradient(to bottom, #32323a 0%, #141414 100%);
filter: progid:DXImageTransform.Microsoft.Gradient(StartColorStr='#32323a', EndColorStr='#141414', GradientType=0);
border: 1px solid #000;
margin: -10px 0px 0px -8px;
padding: 10 0px 10px 80px;
width: 94.8%;
}
a:hover#showall {
}
#ad-wrapper{
margin:0px auto 0px auto;
text-align:center;
}
</style>
</head>
<body>
<div id="aznavbar" class="drop-shadow raised">
<?php
//This creates the menu at the top A-Z
$char = $_GET['letter'];
$list="num";
foreach (range('A', 'Z') as $i) $list.=",$i";
$list.=",Show All Ads";
$a = explode(',', $list);
foreach ($a as $b) {
if (!empty($b)) {
if ($b=="num") {
if ($char=="num") echo "<a href=\"az.php?letter=num\" target=\"frame\">#</a>";
else echo "<a href=\"az.php?letter=num\" target=\"frame\">#</a>";
}
elseif ($b=="Show All Ads") {
if (($char=="*")||(empty($char))) echo "<a href=\"az.php?letter=*\" target=\"frame\">Show All Ads</a>";
else echo "<a href=\"az.php?letter=*\" target=\"frame\">Show All Ads</a>";
}
elseif($b==$char) echo "<a href=\"az.php?letter=".$b."\" target=\"frame\">$b</a>";
else echo "<a href=\"az.php?letter=".$b."\" target=\"frame\">$b</a>";
}
}
?>
</div>
<?php
if(!empty($char)){
include('connect.php');
$tbl_name="amp_ads"; //your table name
/*
First get total number of rows in data table.
If you have a WHERE clause in your query, make sure you mirror it here.
*/
if((empty($char))||($char=="*")) $query = "SELECT COUNT(*) as num FROM $tbl_name";
elseif($char=="num") $query = "SELECT COUNT(*) as num FROM $tbl_name WHERE title REGEXP '^[0-9]'";
else $query = "SELECT COUNT(*) as num FROM $tbl_name WHERE title LIKE '$char%'";
$total_pages = mysql_fetch_array(mysql_query($query));
$total_pages = $total_pages[num];
/* Setup vars for query. */
if(!empty($char)) $targetpage = "az.php?letter=$char&";
else $targetpage = "az.php?"; //your file name (the name of this file)
$page = $_GET['page'];
if($page)
$start = ($page - 1) * $limit; //first item to display on this page
else
$start = 0; //if no page var is given, set start to 0
/* Get data. */
if($char=="*") $sql = "SELECT * FROM $tbl_name LIMIT $start, $limit";
elseif($char=="num") $sql = "SELECT * FROM $tbl_name WHERE title REGEXP '^[0-9]' LIMIT $start, $limit";
else $sql = "SELECT * FROM $tbl_name WHERE title LIKE '$char%' LIMIT $start, $limit";
$result = mysql_query($sql);
/* Setup page vars for display. */
if ($page == 0) $page = 1; //if no page var is given, default to 1.
$prev = $page - 1; //previous page is page - 1
$next = $page + 1; //next page is page + 1
$lastpage = ceil($total_pages/$limit); //lastpage is = total pages / items per page, rounded up.
$lpm1 = $lastpage - 1; //last page minus 1
/*
Now we apply our rules and draw the pagination object.
We're actually saving the code to a variable in case we want to draw it more than once.
*/
$pagination = "";
if($lastpage > 1)
{
$pagination .= "<div class=\"pagination\">";
//previous button
if ($page > 1)
$pagination.= "<a href=\"$targetpage"."page=$prev\">« previous </a>";
else
$pagination.= "<span class=\"disabled\">« previous </span>";
//pages
if ($lastpage < 7 + ($adjacents * 2)) //not enough pages to bother breaking it up
{
for ($counter = 1; $counter <= $lastpage; $counter++)
{
if ($counter == $page)
$pagination.= "<span class=\"current\">$counter</span>";
else
$pagination.= "<a href=\"$targetpage"."page=$counter\">$counter</a>";
}
}
elseif($lastpage > 5 + ($adjacents * 2)) //enough pages to hide some
{
//close to beginning; only hide later pages
if($page < 1 + ($adjacents * 2))
{
for ($counter = 1; $counter < 4 + ($adjacents * 2); $counter++)
{
if ($counter == $page)
$pagination.= "<span class=\"current\">$counter</span>";
else
$pagination.= "<a href=\"$targetpage"."page=$counter\">$counter</a>";
}
$pagination.= "...";
$pagination.= "<a href=\"$targetpage"."page=$lpm1\">$lpm1</a>";
$pagination.= "<a href=\"$targetpage"."page=$lastpage\">$lastpage</a>";
}
//in middle; hide some front and some back
elseif($lastpage - ($adjacents * 2) > $page && $page > ($adjacents * 2))
{
$pagination.= "<a href=\"$targetpage"."page=1\">1</a>";
$pagination.= "<a href=\"$targetpage"."page=2\">2</a>";
$pagination.= "...";
for ($counter = $page - $adjacents; $counter <= $page + $adjacents; $counter++)
{
if ($counter == $page)
$pagination.= "<span class=\"current\">$counter</span>";
else
$pagination.= "<a href=\"$targetpage"."page=$counter\">$counter</a>";
}
$pagination.= "...";
$pagination.= "<a href=\"$targetpage"."page=$lpm1\">$lpm1</a>";
$pagination.= "<a href=\"$targetpage"."page=$lastpage\">$lastpage</a>";
}
//close to end; only hide early pages
else
{
$pagination.= "<a href=\"$targetpage"."page=1\">1</a>";
$pagination.= "<a href=\"$targetpage"."page=2\">2</a>";
$pagination.= "...";
for ($counter = $lastpage - (2 + ($adjacents * 2)); $counter <= $lastpage; $counter++)
{
if ($counter == $page)
$pagination.= "<span class=\"current\">$counter</span>";
else
$pagination.= "<a href=\"$targetpage"."page=$counter\">$counter</a>";
}
}
}
//next button
if ($page < $counter - 1)
$pagination.= "<a href=\"$targetpage"."page=$next\"> next »</a>";
else
$pagination.= "<span class=\"disabled\"> next »</span>";
$pagination.= "</div>\n";
}
?>
<?php
echo '<div id="ad-wrapper">';
if($total_pages==0) echo "No Results for ".$char."!";
else{
$c = -1;
while($row = mysql_fetch_array($result))
{
if($c%$rows==$rows-1) echo "<br/>";
echo "<a href=\"details.php?id=$row[n] \"><img class=\"ads\" alt=\"$row[alt]\" title=\"$row[alt]\" src=\"$row[banner]\"><p /> $row[alt]";
$c++;
$c++;
}
}
}
?>
<?php echo $pagination ?>
</div></body>
</html>
// How many adjacent pages should be shown on each side?
$adjacents = 1; //This only applies to lists that are more then 8 pages (controls the ...'s not the list)
//how many items to show per page
$limit = 10;
//Number of ads per row
$rows = 3;
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
<title>A To Z AD Navigation </title>
<style media="screen" type="text/css">
html, body { }
#aznavbar a:link {
color: #0C7FB0;
font-family:Verdana,Geneva,'DejaVu Sans',sans-serif;
margin-left: 4.15px;
padding: 10px;
text-decoration:none;
}
#aznavbar a:visited {
color: #0C7FB0;
font-family:Verdana,Geneva,'DejaVu Sans',sans-serif;
padding: 10px;
text-decoration:none;
}
#aznavbar a:hover {
background-color: #FA6405;
color:#000;
font-family:Verdana,Geneva,'DejaVu Sans',sans-serif;
padding: 10px;
text-decoration:none;
}
#aznavbar a:active{
color:#FA6405;
font-family:Verdana,Geneva,'DejaVu Sans',sans-serif;
padding: 10px;
text-decoration:none;
}
#aznavbar {
background: #141414;
background: -moz-linear-gradient(top, #32323a 0%, #141414 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #32323a), color-stop(100%, #141414));
background: -webkit-linear-gradient(top, #32323a 0%, #141414 100%);
background: -o-linear-gradient(top, #32323a 0%, #141414 100%);
background: -ms-linear-gradient(top, #32323a 0%, #141414 100%);
background: linear-gradient(to bottom, #32323a 0%, #141414 100%);
filter: progid:DXImageTransform.Microsoft.Gradient(StartColorStr='#32323a', EndColorStr='#141414', GradientType=0);
border: 1px solid #000;
margin: -10px 0px 0px -8px;
padding: 10 0px 10px 80px;
width: 94.8%;
}
a:hover#showall {
}
#ad-wrapper{
margin:0px auto 0px auto;
text-align:center;
}
</style>
</head>
<body>
<div id="aznavbar" class="drop-shadow raised">
<?php
//This creates the menu at the top A-Z
$char = $_GET['letter'];
$list="num";
foreach (range('A', 'Z') as $i) $list.=",$i";
$list.=",Show All Ads";
$a = explode(',', $list);
foreach ($a as $b) {
if (!empty($b)) {
if ($b=="num") {
if ($char=="num") echo "<a href=\"az.php?letter=num\" target=\"frame\">#</a>";
else echo "<a href=\"az.php?letter=num\" target=\"frame\">#</a>";
}
elseif ($b=="Show All Ads") {
if (($char=="*")||(empty($char))) echo "<a href=\"az.php?letter=*\" target=\"frame\">Show All Ads</a>";
else echo "<a href=\"az.php?letter=*\" target=\"frame\">Show All Ads</a>";
}
elseif($b==$char) echo "<a href=\"az.php?letter=".$b."\" target=\"frame\">$b</a>";
else echo "<a href=\"az.php?letter=".$b."\" target=\"frame\">$b</a>";
}
}
?>
</div>
<?php
if(!empty($char)){
include('connect.php');
$tbl_name="amp_ads"; //your table name
/*
First get total number of rows in data table.
If you have a WHERE clause in your query, make sure you mirror it here.
*/
if((empty($char))||($char=="*")) $query = "SELECT COUNT(*) as num FROM $tbl_name";
elseif($char=="num") $query = "SELECT COUNT(*) as num FROM $tbl_name WHERE title REGEXP '^[0-9]'";
else $query = "SELECT COUNT(*) as num FROM $tbl_name WHERE title LIKE '$char%'";
$total_pages = mysql_fetch_array(mysql_query($query));
$total_pages = $total_pages[num];
/* Setup vars for query. */
if(!empty($char)) $targetpage = "az.php?letter=$char&";
else $targetpage = "az.php?"; //your file name (the name of this file)
$page = $_GET['page'];
if($page)
$start = ($page - 1) * $limit; //first item to display on this page
else
$start = 0; //if no page var is given, set start to 0
/* Get data. */
if($char=="*") $sql = "SELECT * FROM $tbl_name LIMIT $start, $limit";
elseif($char=="num") $sql = "SELECT * FROM $tbl_name WHERE title REGEXP '^[0-9]' LIMIT $start, $limit";
else $sql = "SELECT * FROM $tbl_name WHERE title LIKE '$char%' LIMIT $start, $limit";
$result = mysql_query($sql);
/* Setup page vars for display. */
if ($page == 0) $page = 1; //if no page var is given, default to 1.
$prev = $page - 1; //previous page is page - 1
$next = $page + 1; //next page is page + 1
$lastpage = ceil($total_pages/$limit); //lastpage is = total pages / items per page, rounded up.
$lpm1 = $lastpage - 1; //last page minus 1
/*
Now we apply our rules and draw the pagination object.
We're actually saving the code to a variable in case we want to draw it more than once.
*/
$pagination = "";
if($lastpage > 1)
{
$pagination .= "<div class=\"pagination\">";
//previous button
if ($page > 1)
$pagination.= "<a href=\"$targetpage"."page=$prev\">« previous </a>";
else
$pagination.= "<span class=\"disabled\">« previous </span>";
//pages
if ($lastpage < 7 + ($adjacents * 2)) //not enough pages to bother breaking it up
{
for ($counter = 1; $counter <= $lastpage; $counter++)
{
if ($counter == $page)
$pagination.= "<span class=\"current\">$counter</span>";
else
$pagination.= "<a href=\"$targetpage"."page=$counter\">$counter</a>";
}
}
elseif($lastpage > 5 + ($adjacents * 2)) //enough pages to hide some
{
//close to beginning; only hide later pages
if($page < 1 + ($adjacents * 2))
{
for ($counter = 1; $counter < 4 + ($adjacents * 2); $counter++)
{
if ($counter == $page)
$pagination.= "<span class=\"current\">$counter</span>";
else
$pagination.= "<a href=\"$targetpage"."page=$counter\">$counter</a>";
}
$pagination.= "...";
$pagination.= "<a href=\"$targetpage"."page=$lpm1\">$lpm1</a>";
$pagination.= "<a href=\"$targetpage"."page=$lastpage\">$lastpage</a>";
}
//in middle; hide some front and some back
elseif($lastpage - ($adjacents * 2) > $page && $page > ($adjacents * 2))
{
$pagination.= "<a href=\"$targetpage"."page=1\">1</a>";
$pagination.= "<a href=\"$targetpage"."page=2\">2</a>";
$pagination.= "...";
for ($counter = $page - $adjacents; $counter <= $page + $adjacents; $counter++)
{
if ($counter == $page)
$pagination.= "<span class=\"current\">$counter</span>";
else
$pagination.= "<a href=\"$targetpage"."page=$counter\">$counter</a>";
}
$pagination.= "...";
$pagination.= "<a href=\"$targetpage"."page=$lpm1\">$lpm1</a>";
$pagination.= "<a href=\"$targetpage"."page=$lastpage\">$lastpage</a>";
}
//close to end; only hide early pages
else
{
$pagination.= "<a href=\"$targetpage"."page=1\">1</a>";
$pagination.= "<a href=\"$targetpage"."page=2\">2</a>";
$pagination.= "...";
for ($counter = $lastpage - (2 + ($adjacents * 2)); $counter <= $lastpage; $counter++)
{
if ($counter == $page)
$pagination.= "<span class=\"current\">$counter</span>";
else
$pagination.= "<a href=\"$targetpage"."page=$counter\">$counter</a>";
}
}
}
//next button
if ($page < $counter - 1)
$pagination.= "<a href=\"$targetpage"."page=$next\"> next »</a>";
else
$pagination.= "<span class=\"disabled\"> next »</span>";
$pagination.= "</div>\n";
}
?>
<?php
echo '<div id="ad-wrapper">';
if($total_pages==0) echo "No Results for ".$char."!";
else{
$c = -1;
while($row = mysql_fetch_array($result))
{
if($c%$rows==$rows-1) echo "<br/>";
echo "<a href=\"details.php?id=$row[n] \"><img class=\"ads\" alt=\"$row[alt]\" title=\"$row[alt]\" src=\"$row[banner]\"><p /> $row[alt]";
$c++;
$c++;
}
}
}
?>
<?php echo $pagination ?>
</div></body>
</html>
- <?php
- // How many adjacent pages should be shown on each side?
- $adjacents = 1; //This only applies to lists that are more then 8 pages (controls the ...'s not the list)
- //how many items to show per page
- $limit = 10;
- //Number of ads per row
- $rows = 3;
- ?>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
- <head>
- <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
- <title>A To Z AD Navigation </title>
- <style media="screen" type="text/css">
- html, body { }
- #aznavbar a:link {
- color: #0C7FB0;
- font-family:Verdana,Geneva,'DejaVu Sans',sans-serif;
- margin-left: 4.15px;
- padding: 10px;
- text-decoration:none;
- }
- #aznavbar a:visited {
- color: #0C7FB0;
- font-family:Verdana,Geneva,'DejaVu Sans',sans-serif;
- padding: 10px;
- text-decoration:none;
- }
- #aznavbar a:hover {
- background-color: #FA6405;
- color:#000;
- font-family:Verdana,Geneva,'DejaVu Sans',sans-serif;
- padding: 10px;
- text-decoration:none;
- }
- #aznavbar a:active{
- color:#FA6405;
- font-family:Verdana,Geneva,'DejaVu Sans',sans-serif;
- padding: 10px;
- text-decoration:none;
- }
- #aznavbar {
- background: #141414;
- background: -moz-linear-gradient(top, #32323a 0%, #141414 100%);
- background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #32323a), color-stop(100%, #141414));
- background: -webkit-linear-gradient(top, #32323a 0%, #141414 100%);
- background: -o-linear-gradient(top, #32323a 0%, #141414 100%);
- background: -ms-linear-gradient(top, #32323a 0%, #141414 100%);
- background: linear-gradient(to bottom, #32323a 0%, #141414 100%);
- filter: progid:DXImageTransform.Microsoft.Gradient(StartColorStr='#32323a', EndColorStr='#141414', GradientType=0);
- border: 1px solid #000;
- margin: -10px 0px 0px -8px;
- padding: 10 0px 10px 80px;
- width: 94.8%;
- }
- a:hover#showall {
- }
- #ad-wrapper{
- margin:0px auto 0px auto;
- text-align:center;
- }
- </style>
- </head>
- <body>
- <div id="aznavbar" class="drop-shadow raised">
- <?php
- //This creates the menu at the top A-Z
- $char = $_GET['letter'];
- $list="num";
- foreach (range('A', 'Z') as $i) $list.=",$i";
- $list.=",Show All Ads";
- $a = explode(',', $list);
- foreach ($a as $b) {
- if (!empty($b)) {
- if ($b=="num") {
- if ($char=="num") echo "<a href=\"az.php?letter=num\" target=\"frame\">#</a>";
- else echo "<a href=\"az.php?letter=num\" target=\"frame\">#</a>";
- }
- elseif ($b=="Show All Ads") {
- if (($char=="*")||(empty($char))) echo "<a href=\"az.php?letter=*\" target=\"frame\">Show All Ads</a>";
- else echo "<a href=\"az.php?letter=*\" target=\"frame\">Show All Ads</a>";
- }
- elseif($b==$char) echo "<a href=\"az.php?letter=".$b."\" target=\"frame\">$b</a>";
- else echo "<a href=\"az.php?letter=".$b."\" target=\"frame\">$b</a>";
- }
- }
- ?>
- </div>
- <?php
- if(!empty($char)){
- include('connect.php');
- $tbl_name="amp_ads"; //your table name
- /*
- First get total number of rows in data table.
- If you have a WHERE clause in your query, make sure you mirror it here.
- */
- if((empty($char))||($char=="*")) $query = "SELECT COUNT(*) as num FROM $tbl_name";
- elseif($char=="num") $query = "SELECT COUNT(*) as num FROM $tbl_name WHERE title REGEXP '^[0-9]'";
- else $query = "SELECT COUNT(*) as num FROM $tbl_name WHERE title LIKE '$char%'";
- $total_pages = mysql_fetch_array(mysql_query($query));
- $total_pages = $total_pages[num];
- /* Setup vars for query. */
- if(!empty($char)) $targetpage = "az.php?letter=$char&";
- else $targetpage = "az.php?"; //your file name (the name of this file)
- $page = $_GET['page'];
- if($page)
- $start = ($page - 1) * $limit; //first item to display on this page
- else
- $start = 0; //if no page var is given, set start to 0
- /* Get data. */
- if($char=="*") $sql = "SELECT * FROM $tbl_name LIMIT $start, $limit";
- elseif($char=="num") $sql = "SELECT * FROM $tbl_name WHERE title REGEXP '^[0-9]' LIMIT $start, $limit";
- else $sql = "SELECT * FROM $tbl_name WHERE title LIKE '$char%' LIMIT $start, $limit";
- $result = mysql_query($sql);
- /* Setup page vars for display. */
- if ($page == 0) $page = 1; //if no page var is given, default to 1.
- $prev = $page - 1; //previous page is page - 1
- $next = $page + 1; //next page is page + 1
- $lastpage = ceil($total_pages/$limit); //lastpage is = total pages / items per page, rounded up.
- $lpm1 = $lastpage - 1; //last page minus 1
- /*
- Now we apply our rules and draw the pagination object.
- We're actually saving the code to a variable in case we want to draw it more than once.
- */
- $pagination = "";
- if($lastpage > 1)
- {
- $pagination .= "<div class=\"pagination\">";
- //previous button
- if ($page > 1)
- $pagination.= "<a href=\"$targetpage"."page=$prev\">« previous </a>";
- else
- $pagination.= "<span class=\"disabled\">« previous </span>";
- //pages
- if ($lastpage < 7 + ($adjacents * 2)) //not enough pages to bother breaking it up
- {
- for ($counter = 1; $counter <= $lastpage; $counter++)
- {
- if ($counter == $page)
- $pagination.= "<span class=\"current\">$counter</span>";
- else
- $pagination.= "<a href=\"$targetpage"."page=$counter\">$counter</a>";
- }
- }
- elseif($lastpage > 5 + ($adjacents * 2)) //enough pages to hide some
- {
- //close to beginning; only hide later pages
- if($page < 1 + ($adjacents * 2))
- {
- for ($counter = 1; $counter < 4 + ($adjacents * 2); $counter++)
- {
- if ($counter == $page)
- $pagination.= "<span class=\"current\">$counter</span>";
- else
- $pagination.= "<a href=\"$targetpage"."page=$counter\">$counter</a>";
- }
- $pagination.= "...";
- $pagination.= "<a href=\"$targetpage"."page=$lpm1\">$lpm1</a>";
- $pagination.= "<a href=\"$targetpage"."page=$lastpage\">$lastpage</a>";
- }
- //in middle; hide some front and some back
- elseif($lastpage - ($adjacents * 2) > $page && $page > ($adjacents * 2))
- {
- $pagination.= "<a href=\"$targetpage"."page=1\">1</a>";
- $pagination.= "<a href=\"$targetpage"."page=2\">2</a>";
- $pagination.= "...";
- for ($counter = $page - $adjacents; $counter <= $page + $adjacents; $counter++)
- {
- if ($counter == $page)
- $pagination.= "<span class=\"current\">$counter</span>";
- else
- $pagination.= "<a href=\"$targetpage"."page=$counter\">$counter</a>";
- }
- $pagination.= "...";
- $pagination.= "<a href=\"$targetpage"."page=$lpm1\">$lpm1</a>";
- $pagination.= "<a href=\"$targetpage"."page=$lastpage\">$lastpage</a>";
- }
- //close to end; only hide early pages
- else
- {
- $pagination.= "<a href=\"$targetpage"."page=1\">1</a>";
- $pagination.= "<a href=\"$targetpage"."page=2\">2</a>";
- $pagination.= "...";
- for ($counter = $lastpage - (2 + ($adjacents * 2)); $counter <= $lastpage; $counter++)
- {
- if ($counter == $page)
- $pagination.= "<span class=\"current\">$counter</span>";
- else
- $pagination.= "<a href=\"$targetpage"."page=$counter\">$counter</a>";
- }
- }
- }
- //next button
- if ($page < $counter - 1)
- $pagination.= "<a href=\"$targetpage"."page=$next\"> next »</a>";
- else
- $pagination.= "<span class=\"disabled\"> next »</span>";
- $pagination.= "</div>\n";
- }
- ?>
- <?php
- echo '<div id="ad-wrapper">';
- if($total_pages==0) echo "No Results for ".$char."!";
- else{
- $c = -1;
- while($row = mysql_fetch_array($result))
- {
- if($c%$rows==$rows-1) echo "<br/>";
- echo "<a href=\"details.php?id=$row[n] \"><img class=\"ads\" alt=\"$row[alt]\" title=\"$row[alt]\" src=\"$row[banner]\"><p /> $row[alt]";
- $c++;
- $c++;
- }
- }
- }
- ?>
- <?php echo $pagination ?>
- </div></body>
- </html>
Remarque : Les deux pages php ci-dessus fonctionnent très bien sauf pour le fait que les liens dans le premier bloc de code qui est la php inclus alphabet naviation (notamment az.php) le deuxième bloc de code est l'endroit où le bloc de code doit être modifié--juste sous l'élément body dans le deuxième bloc de code, mais je suis naïf quant à ce qui doit être changé.
J'ai attendu si longtemps pour une solution à cela, je n'aime pas dire combien de temps...
Je vous remercie à l'avance !
Brian
- Anonymous
- Bot


- Inscription: 25 Feb 2008
- Messages: ?
- Loc: Ozzuland
- Status: Online
Décembre 31st, 2012, 6:27 pm
- ScottG
- Proficient


- Inscription: Juil 06, 2010
- Messages: 260
- Status: Offline
avez-vous besoin de se débarrasser de le « ouverture dans une nouvelle page » tous ensemble ? dans l'affirmative dans le code qui génère les liens supprimer au paramètre cible. Voici le code que vous avez fourni sans le paramètre target. Non testés
index.php
et Im en supposant que az.php
index.php
PHP Code: [ Select ]
<html>
<head> <title> </title>
<meta name="viewport" content="initial-scale=1.0">
<link rel="stylesheet" type="text/css" href="css/breadcrumb.css" media="screen" charset="utf-8" />
<link rel="stylesheet" type="text/css" href="css/default.css" media="screen" charset="utf-8" />
<link rel="stylesheet" type="text/css" href="css/menu.css" media="screen" charset="utf-8" />
</head>
<body>
<?php include('az.php'); ?>
<div class="drop-shadow lifted" id="header"><img src="/test2/images/logo.png" alt="Reunite My Site - Company Logo" title="Reunite My Site - Company Logo"> </div>
<div id="login">Login: <input type="username" class="login" size="20px;">
<br />
Password: <input class="login" type="password" size="20px">
<br />
Remember Me? <input type="checkbox">
<a href="#">Register Now For Free!</a>
<div class="note orange rounded">Start your Advertising or Publishing Campaign Now by simply clicking the Register Now button above!</div></div>
<?php
if($GET['frame'] == 1) {
//This creates the menu at the top A-Z
$char = $_GET['letter'];
$list="num";
foreach (range('A', 'Z') as $i) $list.=",$i";
$list.=",Show All Ads";
$a = explode(',', $list);
foreach ($a as $b) {
if (!empty($b)) {
if ($b=="num") {
if ($char=="num") echo "<a href=\"az.php?letter=num\">#</a>";
else echo "<a href=\"az.php?letter=num\">#</a>";
}
elseif ($b=="Show All Ads") {
if (($char=="*")||(empty($char))) echo "<a href=\"az.php?letter=*\">Show All Ads</a>";
else echo "<a href=\"az.php?letter=*\">Show All Ads</a>";
}
elseif($b==$char) echo "<a href=\"az.php?letter=".$b."\">$b</a>";
else echo "<a href=\"az.php?letter=".$b."\">$b</a>";
}
}
}
?>
<iframe name="frame">Sorry, you need the newest browser to display iframes!</iframe>
</body>
</html>
<head> <title> </title>
<meta name="viewport" content="initial-scale=1.0">
<link rel="stylesheet" type="text/css" href="css/breadcrumb.css" media="screen" charset="utf-8" />
<link rel="stylesheet" type="text/css" href="css/default.css" media="screen" charset="utf-8" />
<link rel="stylesheet" type="text/css" href="css/menu.css" media="screen" charset="utf-8" />
</head>
<body>
<?php include('az.php'); ?>
<div class="drop-shadow lifted" id="header"><img src="/test2/images/logo.png" alt="Reunite My Site - Company Logo" title="Reunite My Site - Company Logo"> </div>
<div id="login">Login: <input type="username" class="login" size="20px;">
<br />
Password: <input class="login" type="password" size="20px">
<br />
Remember Me? <input type="checkbox">
<a href="#">Register Now For Free!</a>
<div class="note orange rounded">Start your Advertising or Publishing Campaign Now by simply clicking the Register Now button above!</div></div>
<?php
if($GET['frame'] == 1) {
//This creates the menu at the top A-Z
$char = $_GET['letter'];
$list="num";
foreach (range('A', 'Z') as $i) $list.=",$i";
$list.=",Show All Ads";
$a = explode(',', $list);
foreach ($a as $b) {
if (!empty($b)) {
if ($b=="num") {
if ($char=="num") echo "<a href=\"az.php?letter=num\">#</a>";
else echo "<a href=\"az.php?letter=num\">#</a>";
}
elseif ($b=="Show All Ads") {
if (($char=="*")||(empty($char))) echo "<a href=\"az.php?letter=*\">Show All Ads</a>";
else echo "<a href=\"az.php?letter=*\">Show All Ads</a>";
}
elseif($b==$char) echo "<a href=\"az.php?letter=".$b."\">$b</a>";
else echo "<a href=\"az.php?letter=".$b."\">$b</a>";
}
}
}
?>
<iframe name="frame">Sorry, you need the newest browser to display iframes!</iframe>
</body>
</html>
- <html>
- <head> <title> </title>
- <meta name="viewport" content="initial-scale=1.0">
- <link rel="stylesheet" type="text/css" href="css/breadcrumb.css" media="screen" charset="utf-8" />
- <link rel="stylesheet" type="text/css" href="css/default.css" media="screen" charset="utf-8" />
- <link rel="stylesheet" type="text/css" href="css/menu.css" media="screen" charset="utf-8" />
- </head>
- <body>
- <?php include('az.php'); ?>
- <div class="drop-shadow lifted" id="header"><img src="/test2/images/logo.png" alt="Reunite My Site - Company Logo" title="Reunite My Site - Company Logo"> </div>
- <div id="login">Login: <input type="username" class="login" size="20px;">
- <br />
- Password: <input class="login" type="password" size="20px">
- <br />
- Remember Me? <input type="checkbox">
- <a href="#">Register Now For Free!</a>
- <div class="note orange rounded">Start your Advertising or Publishing Campaign Now by simply clicking the Register Now button above!</div></div>
- <?php
- if($GET['frame'] == 1) {
- //This creates the menu at the top A-Z
- $char = $_GET['letter'];
- $list="num";
- foreach (range('A', 'Z') as $i) $list.=",$i";
- $list.=",Show All Ads";
- $a = explode(',', $list);
- foreach ($a as $b) {
- if (!empty($b)) {
- if ($b=="num") {
- if ($char=="num") echo "<a href=\"az.php?letter=num\">#</a>";
- else echo "<a href=\"az.php?letter=num\">#</a>";
- }
- elseif ($b=="Show All Ads") {
- if (($char=="*")||(empty($char))) echo "<a href=\"az.php?letter=*\">Show All Ads</a>";
- else echo "<a href=\"az.php?letter=*\">Show All Ads</a>";
- }
- elseif($b==$char) echo "<a href=\"az.php?letter=".$b."\">$b</a>";
- else echo "<a href=\"az.php?letter=".$b."\">$b</a>";
- }
- }
- }
- ?>
- <iframe name="frame">Sorry, you need the newest browser to display iframes!</iframe>
- </body>
- </html>
et Im en supposant que az.php
PHP Code: [ Select ]
<?php
// How many adjacent pages should be shown on each side?
$adjacents = 1; //This only applies to lists that are more then 8 pages (controls the ...'s not the list)
//how many items to show per page
$limit = 10;
//Number of ads per row
$rows = 3;
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
<title>A To Z AD Navigation </title>
<style media="screen" type="text/css">
html, body { }
#aznavbar a:link {
color: #0C7FB0;
font-family:Verdana,Geneva,'DejaVu Sans',sans-serif;
margin-left: 4.15px;
padding: 10px;
text-decoration:none;
}
#aznavbar a:visited {
color: #0C7FB0;
font-family:Verdana,Geneva,'DejaVu Sans',sans-serif;
padding: 10px;
text-decoration:none;
}
#aznavbar a:hover {
background-color: #FA6405;
color:#000;
font-family:Verdana,Geneva,'DejaVu Sans',sans-serif;
padding: 10px;
text-decoration:none;
}
#aznavbar a:active{
color:#FA6405;
font-family:Verdana,Geneva,'DejaVu Sans',sans-serif;
padding: 10px;
text-decoration:none;
}
#aznavbar {
background: #141414;
background: -moz-linear-gradient(top, #32323a 0%, #141414 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #32323a), color-stop(100%, #141414));
background: -webkit-linear-gradient(top, #32323a 0%, #141414 100%);
background: -o-linear-gradient(top, #32323a 0%, #141414 100%);
background: -ms-linear-gradient(top, #32323a 0%, #141414 100%);
background: linear-gradient(to bottom, #32323a 0%, #141414 100%);
filter: progid:DXImageTransform.Microsoft.Gradient(StartColorStr='#32323a', EndColorStr='#141414', GradientType=0);
border: 1px solid #000;
margin: -10px 0px 0px -8px;
padding: 10 0px 10px 80px;
width: 94.8%;
}
a:hover#showall {
}
#ad-wrapper{
margin:0px auto 0px auto;
text-align:center;
}
</style>
</head>
<body>
<div id="aznavbar" class="drop-shadow raised">
<?php
//This creates the menu at the top A-Z
$char = $_GET['letter'];
$list="num";
foreach (range('A', 'Z') as $i) $list.=",$i";
$list.=",Show All Ads";
$a = explode(',', $list);
foreach ($a as $b) {
if (!empty($b)) {
if ($b=="num") {
if ($char=="num") echo "<a href=\"az.php?letter=num\">#</a>";
else echo "<a href=\"az.php?letter=num\">#</a>";
}
elseif ($b=="Show All Ads") {
if (($char=="*")||(empty($char))) echo "<a href=\"az.php?letter=*\">Show All Ads</a>";
else echo "<a href=\"az.php?letter=*\">Show All Ads</a>";
}
elseif($b==$char) echo "<a href=\"az.php?letter=".$b."\">$b</a>";
else echo "<a href=\"az.php?letter=".$b."\">$b</a>";
}
}
?>
</div>
<?php
if(!empty($char)){
include('connect.php');
$tbl_name="amp_ads"; //your table name
/*
First get total number of rows in data table.
If you have a WHERE clause in your query, make sure you mirror it here.
*/
if((empty($char))||($char=="*")) $query = "SELECT COUNT(*) as num FROM $tbl_name";
elseif($char=="num") $query = "SELECT COUNT(*) as num FROM $tbl_name WHERE title REGEXP '^[0-9]'";
else $query = "SELECT COUNT(*) as num FROM $tbl_name WHERE title LIKE '$char%'";
$total_pages = mysql_fetch_array(mysql_query($query));
$total_pages = $total_pages[num];
/* Setup vars for query. */
if(!empty($char)) $targetpage = "az.php?letter=$char&";
else $targetpage = "az.php?"; //your file name (the name of this file)
$page = $_GET['page'];
if($page)
$start = ($page - 1) * $limit; //first item to display on this page
else
$start = 0; //if no page var is given, set start to 0
/* Get data. */
if($char=="*") $sql = "SELECT * FROM $tbl_name LIMIT $start, $limit";
elseif($char=="num") $sql = "SELECT * FROM $tbl_name WHERE title REGEXP '^[0-9]' LIMIT $start, $limit";
else $sql = "SELECT * FROM $tbl_name WHERE title LIKE '$char%' LIMIT $start, $limit";
$result = mysql_query($sql);
/* Setup page vars for display. */
if ($page == 0) $page = 1; //if no page var is given, default to 1.
$prev = $page - 1; //previous page is page - 1
$next = $page + 1; //next page is page + 1
$lastpage = ceil($total_pages/$limit); //lastpage is = total pages / items per page, rounded up.
$lpm1 = $lastpage - 1; //last page minus 1
/*
Now we apply our rules and draw the pagination object.
We're actually saving the code to a variable in case we want to draw it more than once.
*/
$pagination = "";
if($lastpage > 1)
{
$pagination .= "<div class=\"pagination\">";
//previous button
if ($page > 1)
$pagination.= "<a href=\"$targetpage"."page=$prev\">« previous </a>";
else
$pagination.= "<span class=\"disabled\">« previous </span>";
//pages
if ($lastpage < 7 + ($adjacents * 2)) //not enough pages to bother breaking it up
{
for ($counter = 1; $counter <= $lastpage; $counter++)
{
if ($counter == $page)
$pagination.= "<span class=\"current\">$counter</span>";
else
$pagination.= "<a href=\"$targetpage"."page=$counter\">$counter</a>";
}
}
elseif($lastpage > 5 + ($adjacents * 2)) //enough pages to hide some
{
//close to beginning; only hide later pages
if($page < 1 + ($adjacents * 2))
{
for ($counter = 1; $counter < 4 + ($adjacents * 2); $counter++)
{
if ($counter == $page)
$pagination.= "<span class=\"current\">$counter</span>";
else
$pagination.= "<a href=\"$targetpage"."page=$counter\">$counter</a>";
}
$pagination.= "...";
$pagination.= "<a href=\"$targetpage"."page=$lpm1\">$lpm1</a>";
$pagination.= "<a href=\"$targetpage"."page=$lastpage\">$lastpage</a>";
}
//in middle; hide some front and some back
elseif($lastpage - ($adjacents * 2) > $page && $page > ($adjacents * 2))
{
$pagination.= "<a href=\"$targetpage"."page=1\">1</a>";
$pagination.= "<a href=\"$targetpage"."page=2\">2</a>";
$pagination.= "...";
for ($counter = $page - $adjacents; $counter <= $page + $adjacents; $counter++)
{
if ($counter == $page)
$pagination.= "<span class=\"current\">$counter</span>";
else
$pagination.= "<a href=\"$targetpage"."page=$counter\">$counter</a>";
}
$pagination.= "...";
$pagination.= "<a href=\"$targetpage"."page=$lpm1\">$lpm1</a>";
$pagination.= "<a href=\"$targetpage"."page=$lastpage\">$lastpage</a>";
}
//close to end; only hide early pages
else
{
$pagination.= "<a href=\"$targetpage"."page=1\">1</a>";
$pagination.= "<a href=\"$targetpage"."page=2\">2</a>";
$pagination.= "...";
for ($counter = $lastpage - (2 + ($adjacents * 2)); $counter <= $lastpage; $counter++)
{
if ($counter == $page)
$pagination.= "<span class=\"current\">$counter</span>";
else
$pagination.= "<a href=\"$targetpage"."page=$counter\">$counter</a>";
}
}
}
//next button
if ($page < $counter - 1)
$pagination.= "<a href=\"$targetpage"."page=$next\"> next »</a>";
else
$pagination.= "<span class=\"disabled\"> next »</span>";
$pagination.= "</div>\n";
}
?>
<?php
echo '<div id="ad-wrapper">';
if($total_pages==0) echo "No Results for ".$char."!";
else{
$c = -1;
while($row = mysql_fetch_array($result))
{
if($c%$rows==$rows-1) echo "<br/>";
echo "<a href=\"details.php?id=$row[n] \"><img class=\"ads\" alt=\"$row[alt]\" title=\"$row[alt]\" src=\"$row[banner]\"><p /> $row[alt]";
$c++;
$c++;
}
}
}
?>
<?php echo $pagination ?>
</div></body>
</html>
// How many adjacent pages should be shown on each side?
$adjacents = 1; //This only applies to lists that are more then 8 pages (controls the ...'s not the list)
//how many items to show per page
$limit = 10;
//Number of ads per row
$rows = 3;
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
<title>A To Z AD Navigation </title>
<style media="screen" type="text/css">
html, body { }
#aznavbar a:link {
color: #0C7FB0;
font-family:Verdana,Geneva,'DejaVu Sans',sans-serif;
margin-left: 4.15px;
padding: 10px;
text-decoration:none;
}
#aznavbar a:visited {
color: #0C7FB0;
font-family:Verdana,Geneva,'DejaVu Sans',sans-serif;
padding: 10px;
text-decoration:none;
}
#aznavbar a:hover {
background-color: #FA6405;
color:#000;
font-family:Verdana,Geneva,'DejaVu Sans',sans-serif;
padding: 10px;
text-decoration:none;
}
#aznavbar a:active{
color:#FA6405;
font-family:Verdana,Geneva,'DejaVu Sans',sans-serif;
padding: 10px;
text-decoration:none;
}
#aznavbar {
background: #141414;
background: -moz-linear-gradient(top, #32323a 0%, #141414 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #32323a), color-stop(100%, #141414));
background: -webkit-linear-gradient(top, #32323a 0%, #141414 100%);
background: -o-linear-gradient(top, #32323a 0%, #141414 100%);
background: -ms-linear-gradient(top, #32323a 0%, #141414 100%);
background: linear-gradient(to bottom, #32323a 0%, #141414 100%);
filter: progid:DXImageTransform.Microsoft.Gradient(StartColorStr='#32323a', EndColorStr='#141414', GradientType=0);
border: 1px solid #000;
margin: -10px 0px 0px -8px;
padding: 10 0px 10px 80px;
width: 94.8%;
}
a:hover#showall {
}
#ad-wrapper{
margin:0px auto 0px auto;
text-align:center;
}
</style>
</head>
<body>
<div id="aznavbar" class="drop-shadow raised">
<?php
//This creates the menu at the top A-Z
$char = $_GET['letter'];
$list="num";
foreach (range('A', 'Z') as $i) $list.=",$i";
$list.=",Show All Ads";
$a = explode(',', $list);
foreach ($a as $b) {
if (!empty($b)) {
if ($b=="num") {
if ($char=="num") echo "<a href=\"az.php?letter=num\">#</a>";
else echo "<a href=\"az.php?letter=num\">#</a>";
}
elseif ($b=="Show All Ads") {
if (($char=="*")||(empty($char))) echo "<a href=\"az.php?letter=*\">Show All Ads</a>";
else echo "<a href=\"az.php?letter=*\">Show All Ads</a>";
}
elseif($b==$char) echo "<a href=\"az.php?letter=".$b."\">$b</a>";
else echo "<a href=\"az.php?letter=".$b."\">$b</a>";
}
}
?>
</div>
<?php
if(!empty($char)){
include('connect.php');
$tbl_name="amp_ads"; //your table name
/*
First get total number of rows in data table.
If you have a WHERE clause in your query, make sure you mirror it here.
*/
if((empty($char))||($char=="*")) $query = "SELECT COUNT(*) as num FROM $tbl_name";
elseif($char=="num") $query = "SELECT COUNT(*) as num FROM $tbl_name WHERE title REGEXP '^[0-9]'";
else $query = "SELECT COUNT(*) as num FROM $tbl_name WHERE title LIKE '$char%'";
$total_pages = mysql_fetch_array(mysql_query($query));
$total_pages = $total_pages[num];
/* Setup vars for query. */
if(!empty($char)) $targetpage = "az.php?letter=$char&";
else $targetpage = "az.php?"; //your file name (the name of this file)
$page = $_GET['page'];
if($page)
$start = ($page - 1) * $limit; //first item to display on this page
else
$start = 0; //if no page var is given, set start to 0
/* Get data. */
if($char=="*") $sql = "SELECT * FROM $tbl_name LIMIT $start, $limit";
elseif($char=="num") $sql = "SELECT * FROM $tbl_name WHERE title REGEXP '^[0-9]' LIMIT $start, $limit";
else $sql = "SELECT * FROM $tbl_name WHERE title LIKE '$char%' LIMIT $start, $limit";
$result = mysql_query($sql);
/* Setup page vars for display. */
if ($page == 0) $page = 1; //if no page var is given, default to 1.
$prev = $page - 1; //previous page is page - 1
$next = $page + 1; //next page is page + 1
$lastpage = ceil($total_pages/$limit); //lastpage is = total pages / items per page, rounded up.
$lpm1 = $lastpage - 1; //last page minus 1
/*
Now we apply our rules and draw the pagination object.
We're actually saving the code to a variable in case we want to draw it more than once.
*/
$pagination = "";
if($lastpage > 1)
{
$pagination .= "<div class=\"pagination\">";
//previous button
if ($page > 1)
$pagination.= "<a href=\"$targetpage"."page=$prev\">« previous </a>";
else
$pagination.= "<span class=\"disabled\">« previous </span>";
//pages
if ($lastpage < 7 + ($adjacents * 2)) //not enough pages to bother breaking it up
{
for ($counter = 1; $counter <= $lastpage; $counter++)
{
if ($counter == $page)
$pagination.= "<span class=\"current\">$counter</span>";
else
$pagination.= "<a href=\"$targetpage"."page=$counter\">$counter</a>";
}
}
elseif($lastpage > 5 + ($adjacents * 2)) //enough pages to hide some
{
//close to beginning; only hide later pages
if($page < 1 + ($adjacents * 2))
{
for ($counter = 1; $counter < 4 + ($adjacents * 2); $counter++)
{
if ($counter == $page)
$pagination.= "<span class=\"current\">$counter</span>";
else
$pagination.= "<a href=\"$targetpage"."page=$counter\">$counter</a>";
}
$pagination.= "...";
$pagination.= "<a href=\"$targetpage"."page=$lpm1\">$lpm1</a>";
$pagination.= "<a href=\"$targetpage"."page=$lastpage\">$lastpage</a>";
}
//in middle; hide some front and some back
elseif($lastpage - ($adjacents * 2) > $page && $page > ($adjacents * 2))
{
$pagination.= "<a href=\"$targetpage"."page=1\">1</a>";
$pagination.= "<a href=\"$targetpage"."page=2\">2</a>";
$pagination.= "...";
for ($counter = $page - $adjacents; $counter <= $page + $adjacents; $counter++)
{
if ($counter == $page)
$pagination.= "<span class=\"current\">$counter</span>";
else
$pagination.= "<a href=\"$targetpage"."page=$counter\">$counter</a>";
}
$pagination.= "...";
$pagination.= "<a href=\"$targetpage"."page=$lpm1\">$lpm1</a>";
$pagination.= "<a href=\"$targetpage"."page=$lastpage\">$lastpage</a>";
}
//close to end; only hide early pages
else
{
$pagination.= "<a href=\"$targetpage"."page=1\">1</a>";
$pagination.= "<a href=\"$targetpage"."page=2\">2</a>";
$pagination.= "...";
for ($counter = $lastpage - (2 + ($adjacents * 2)); $counter <= $lastpage; $counter++)
{
if ($counter == $page)
$pagination.= "<span class=\"current\">$counter</span>";
else
$pagination.= "<a href=\"$targetpage"."page=$counter\">$counter</a>";
}
}
}
//next button
if ($page < $counter - 1)
$pagination.= "<a href=\"$targetpage"."page=$next\"> next »</a>";
else
$pagination.= "<span class=\"disabled\"> next »</span>";
$pagination.= "</div>\n";
}
?>
<?php
echo '<div id="ad-wrapper">';
if($total_pages==0) echo "No Results for ".$char."!";
else{
$c = -1;
while($row = mysql_fetch_array($result))
{
if($c%$rows==$rows-1) echo "<br/>";
echo "<a href=\"details.php?id=$row[n] \"><img class=\"ads\" alt=\"$row[alt]\" title=\"$row[alt]\" src=\"$row[banner]\"><p /> $row[alt]";
$c++;
$c++;
}
}
}
?>
<?php echo $pagination ?>
</div></body>
</html>
- <?php
- // How many adjacent pages should be shown on each side?
- $adjacents = 1; //This only applies to lists that are more then 8 pages (controls the ...'s not the list)
- //how many items to show per page
- $limit = 10;
- //Number of ads per row
- $rows = 3;
- ?>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
- <head>
- <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
- <title>A To Z AD Navigation </title>
- <style media="screen" type="text/css">
- html, body { }
- #aznavbar a:link {
- color: #0C7FB0;
- font-family:Verdana,Geneva,'DejaVu Sans',sans-serif;
- margin-left: 4.15px;
- padding: 10px;
- text-decoration:none;
- }
- #aznavbar a:visited {
- color: #0C7FB0;
- font-family:Verdana,Geneva,'DejaVu Sans',sans-serif;
- padding: 10px;
- text-decoration:none;
- }
- #aznavbar a:hover {
- background-color: #FA6405;
- color:#000;
- font-family:Verdana,Geneva,'DejaVu Sans',sans-serif;
- padding: 10px;
- text-decoration:none;
- }
- #aznavbar a:active{
- color:#FA6405;
- font-family:Verdana,Geneva,'DejaVu Sans',sans-serif;
- padding: 10px;
- text-decoration:none;
- }
- #aznavbar {
- background: #141414;
- background: -moz-linear-gradient(top, #32323a 0%, #141414 100%);
- background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #32323a), color-stop(100%, #141414));
- background: -webkit-linear-gradient(top, #32323a 0%, #141414 100%);
- background: -o-linear-gradient(top, #32323a 0%, #141414 100%);
- background: -ms-linear-gradient(top, #32323a 0%, #141414 100%);
- background: linear-gradient(to bottom, #32323a 0%, #141414 100%);
- filter: progid:DXImageTransform.Microsoft.Gradient(StartColorStr='#32323a', EndColorStr='#141414', GradientType=0);
- border: 1px solid #000;
- margin: -10px 0px 0px -8px;
- padding: 10 0px 10px 80px;
- width: 94.8%;
- }
- a:hover#showall {
- }
- #ad-wrapper{
- margin:0px auto 0px auto;
- text-align:center;
- }
- </style>
- </head>
- <body>
- <div id="aznavbar" class="drop-shadow raised">
- <?php
- //This creates the menu at the top A-Z
- $char = $_GET['letter'];
- $list="num";
- foreach (range('A', 'Z') as $i) $list.=",$i";
- $list.=",Show All Ads";
- $a = explode(',', $list);
- foreach ($a as $b) {
- if (!empty($b)) {
- if ($b=="num") {
- if ($char=="num") echo "<a href=\"az.php?letter=num\">#</a>";
- else echo "<a href=\"az.php?letter=num\">#</a>";
- }
- elseif ($b=="Show All Ads") {
- if (($char=="*")||(empty($char))) echo "<a href=\"az.php?letter=*\">Show All Ads</a>";
- else echo "<a href=\"az.php?letter=*\">Show All Ads</a>";
- }
- elseif($b==$char) echo "<a href=\"az.php?letter=".$b."\">$b</a>";
- else echo "<a href=\"az.php?letter=".$b."\">$b</a>";
- }
- }
- ?>
- </div>
- <?php
- if(!empty($char)){
- include('connect.php');
- $tbl_name="amp_ads"; //your table name
- /*
- First get total number of rows in data table.
- If you have a WHERE clause in your query, make sure you mirror it here.
- */
- if((empty($char))||($char=="*")) $query = "SELECT COUNT(*) as num FROM $tbl_name";
- elseif($char=="num") $query = "SELECT COUNT(*) as num FROM $tbl_name WHERE title REGEXP '^[0-9]'";
- else $query = "SELECT COUNT(*) as num FROM $tbl_name WHERE title LIKE '$char%'";
- $total_pages = mysql_fetch_array(mysql_query($query));
- $total_pages = $total_pages[num];
- /* Setup vars for query. */
- if(!empty($char)) $targetpage = "az.php?letter=$char&";
- else $targetpage = "az.php?"; //your file name (the name of this file)
- $page = $_GET['page'];
- if($page)
- $start = ($page - 1) * $limit; //first item to display on this page
- else
- $start = 0; //if no page var is given, set start to 0
- /* Get data. */
- if($char=="*") $sql = "SELECT * FROM $tbl_name LIMIT $start, $limit";
- elseif($char=="num") $sql = "SELECT * FROM $tbl_name WHERE title REGEXP '^[0-9]' LIMIT $start, $limit";
- else $sql = "SELECT * FROM $tbl_name WHERE title LIKE '$char%' LIMIT $start, $limit";
- $result = mysql_query($sql);
- /* Setup page vars for display. */
- if ($page == 0) $page = 1; //if no page var is given, default to 1.
- $prev = $page - 1; //previous page is page - 1
- $next = $page + 1; //next page is page + 1
- $lastpage = ceil($total_pages/$limit); //lastpage is = total pages / items per page, rounded up.
- $lpm1 = $lastpage - 1; //last page minus 1
- /*
- Now we apply our rules and draw the pagination object.
- We're actually saving the code to a variable in case we want to draw it more than once.
- */
- $pagination = "";
- if($lastpage > 1)
- {
- $pagination .= "<div class=\"pagination\">";
- //previous button
- if ($page > 1)
- $pagination.= "<a href=\"$targetpage"."page=$prev\">« previous </a>";
- else
- $pagination.= "<span class=\"disabled\">« previous </span>";
- //pages
- if ($lastpage < 7 + ($adjacents * 2)) //not enough pages to bother breaking it up
- {
- for ($counter = 1; $counter <= $lastpage; $counter++)
- {
- if ($counter == $page)
- $pagination.= "<span class=\"current\">$counter</span>";
- else
- $pagination.= "<a href=\"$targetpage"."page=$counter\">$counter</a>";
- }
- }
- elseif($lastpage > 5 + ($adjacents * 2)) //enough pages to hide some
- {
- //close to beginning; only hide later pages
- if($page < 1 + ($adjacents * 2))
- {
- for ($counter = 1; $counter < 4 + ($adjacents * 2); $counter++)
- {
- if ($counter == $page)
- $pagination.= "<span class=\"current\">$counter</span>";
- else
- $pagination.= "<a href=\"$targetpage"."page=$counter\">$counter</a>";
- }
- $pagination.= "...";
- $pagination.= "<a href=\"$targetpage"."page=$lpm1\">$lpm1</a>";
- $pagination.= "<a href=\"$targetpage"."page=$lastpage\">$lastpage</a>";
- }
- //in middle; hide some front and some back
- elseif($lastpage - ($adjacents * 2) > $page && $page > ($adjacents * 2))
- {
- $pagination.= "<a href=\"$targetpage"."page=1\">1</a>";
- $pagination.= "<a href=\"$targetpage"."page=2\">2</a>";
- $pagination.= "...";
- for ($counter = $page - $adjacents; $counter <= $page + $adjacents; $counter++)
- {
- if ($counter == $page)
- $pagination.= "<span class=\"current\">$counter</span>";
- else
- $pagination.= "<a href=\"$targetpage"."page=$counter\">$counter</a>";
- }
- $pagination.= "...";
- $pagination.= "<a href=\"$targetpage"."page=$lpm1\">$lpm1</a>";
- $pagination.= "<a href=\"$targetpage"."page=$lastpage\">$lastpage</a>";
- }
- //close to end; only hide early pages
- else
- {
- $pagination.= "<a href=\"$targetpage"."page=1\">1</a>";
- $pagination.= "<a href=\"$targetpage"."page=2\">2</a>";
- $pagination.= "...";
- for ($counter = $lastpage - (2 + ($adjacents * 2)); $counter <= $lastpage; $counter++)
- {
- if ($counter == $page)
- $pagination.= "<span class=\"current\">$counter</span>";
- else
- $pagination.= "<a href=\"$targetpage"."page=$counter\">$counter</a>";
- }
- }
- }
- //next button
- if ($page < $counter - 1)
- $pagination.= "<a href=\"$targetpage"."page=$next\"> next »</a>";
- else
- $pagination.= "<span class=\"disabled\"> next »</span>";
- $pagination.= "</div>\n";
- }
- ?>
- <?php
- echo '<div id="ad-wrapper">';
- if($total_pages==0) echo "No Results for ".$char."!";
- else{
- $c = -1;
- while($row = mysql_fetch_array($result))
- {
- if($c%$rows==$rows-1) echo "<br/>";
- echo "<a href=\"details.php?id=$row[n] \"><img class=\"ads\" alt=\"$row[alt]\" title=\"$row[alt]\" src=\"$row[banner]\"><p /> $row[alt]";
- $c++;
- $c++;
- }
- }
- }
- ?>
- <?php echo $pagination ?>
- </div></body>
- </html>
- Brian Jester
- Beginner


- Inscription: Jan 06, 2006
- Messages: 61
- Loc: Bayonne, New Jersey USA
- Status: Offline
Code fait toujours la même chose...j'ai mis la cible = partie « frame » dans la page az.php dans les liens situés dans cette région :
et quand je clique sur les liens dans la barre de navigation az, je reçois toujours la partie css ( #, a-z, afficher tous les liens) dans l'iframe, je ne veux pas que, juste le MySQL résultats partie...
Je * pense ** (sauf si je suis sur la pensée de toute cette affaire) la partie qui crée le menu az (liens) dans la page de az.php doit être supprimé et j'aurais besoin de créer une nouvelle barre de navigation (essentiellement en html et css, sans php) dans la page index.php, mais le reste du code dans le az.php devra être mis à jour pour refléter ces modifications.
J'espère que vous comprenez !
Merci encore !
Brian
Quote:
//This crée le menu en haut de A à z
et quand je clique sur les liens dans la barre de navigation az, je reçois toujours la partie css ( #, a-z, afficher tous les liens) dans l'iframe, je ne veux pas que, juste le MySQL résultats partie...
Je * pense ** (sauf si je suis sur la pensée de toute cette affaire) la partie qui crée le menu az (liens) dans la page de az.php doit être supprimé et j'aurais besoin de créer une nouvelle barre de navigation (essentiellement en html et css, sans php) dans la page index.php, mais le reste du code dans le az.php devra être mis à jour pour refléter ces modifications.
J'espère que vous comprenez !
Merci encore !
Brian
- ScottG
- Proficient


- Inscription: Juil 06, 2010
- Messages: 260
- Status: Offline
Peut-être que je ne comprends pas ce que vous essayez d'accomplir. J'ai couru le code que j'ai mis dans mon dernier post, et outre les erreurs de mysql (puisque je n'ai pas cette partie du code) il ouvre le az.php dans la même fenêtre comme indice (commutateur de nombre total de pages).
Êtes-vous essayer de cibler seulement l'iframe avec la navigation et charger seulement les résultats dans l'iframe ?
Êtes-vous essayer de cibler seulement l'iframe avec la navigation et charger seulement les résultats dans l'iframe ?
- ScottG
- Proficient


- Inscription: Juil 06, 2010
- Messages: 260
- Status: Offline
Si tel est le cas, cependant, à l'aide de la même page, affectez le résultat et la navigation va vous donner un mal de tête. Les diviser en deux fichiers différents.
index.php
AZ.php
Results.php
index.php
PHP Code: [ Select ]
<html>
<head> <title> </title>
<meta name="viewport" content="initial-scale=1.0">
<link rel="stylesheet" type="text/css" href="css/breadcrumb.css" media="screen" charset="utf-8" />
<link rel="stylesheet" type="text/css" href="css/default.css" media="screen" charset="utf-8" />
<link rel="stylesheet" type="text/css" href="css/menu.css" media="screen" charset="utf-8" />
<style media="screen" type="text/css">
html, body { }
#aznavbar a:link {
color: #0C7FB0;
font-family:Verdana,Geneva,'DejaVu Sans',sans-serif;
margin-left: 4.15px;
padding: 10px;
text-decoration:none;
}
#aznavbar a:visited {
color: #0C7FB0;
font-family:Verdana,Geneva,'DejaVu Sans',sans-serif;
padding: 10px;
text-decoration:none;
}
#aznavbar a:hover {
background-color: #FA6405;
color:#000;
font-family:Verdana,Geneva,'DejaVu Sans',sans-serif;
padding: 10px;
text-decoration:none;
}
#aznavbar a:active{
color:#FA6405;
font-family:Verdana,Geneva,'DejaVu Sans',sans-serif;
padding: 10px;
text-decoration:none;
}
#aznavbar {
background: #141414;
background: -moz-linear-gradient(top, #32323a 0%, #141414 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #32323a), color-stop(100%, #141414));
background: -webkit-linear-gradient(top, #32323a 0%, #141414 100%);
background: -o-linear-gradient(top, #32323a 0%, #141414 100%);
background: -ms-linear-gradient(top, #32323a 0%, #141414 100%);
background: linear-gradient(to bottom, #32323a 0%, #141414 100%);
filter: progid:DXImageTransform.Microsoft.Gradient(StartColorStr='#32323a', EndColorStr='#141414', GradientType=0);
border: 1px solid #000;
margin: -10px 0px 0px -8px;
padding: 10 0px 10px 80px;
width: 94.8%;
}
a:hover#showall {
}
#ad-wrapper{
margin:0px auto 0px auto;
text-align:center;
}
</style>
</head>
<body>
<?php include('az.php'); ?>
<div class="drop-shadow lifted" id="header"><img src="/test2/images/logo.png" alt="Reunite My Site - Company Logo" title="Reunite My Site - Company Logo"> </div>
<div id="login">Login: <input type="username" class="login" size="20px;">
<br />
Password: <input class="login" type="password" size="20px">
<br />
Remember Me? <input type="checkbox">
<a href="#">Register Now For Free!</a>
<div class="note orange rounded">Start your Advertising or Publishing Campaign Now by simply clicking the Register Now button above!</div></div>
<iframe name="frame">Sorry, you need the newest browser to display iframes!</iframe>
</body>
</html>
<head> <title> </title>
<meta name="viewport" content="initial-scale=1.0">
<link rel="stylesheet" type="text/css" href="css/breadcrumb.css" media="screen" charset="utf-8" />
<link rel="stylesheet" type="text/css" href="css/default.css" media="screen" charset="utf-8" />
<link rel="stylesheet" type="text/css" href="css/menu.css" media="screen" charset="utf-8" />
<style media="screen" type="text/css">
html, body { }
#aznavbar a:link {
color: #0C7FB0;
font-family:Verdana,Geneva,'DejaVu Sans',sans-serif;
margin-left: 4.15px;
padding: 10px;
text-decoration:none;
}
#aznavbar a:visited {
color: #0C7FB0;
font-family:Verdana,Geneva,'DejaVu Sans',sans-serif;
padding: 10px;
text-decoration:none;
}
#aznavbar a:hover {
background-color: #FA6405;
color:#000;
font-family:Verdana,Geneva,'DejaVu Sans',sans-serif;
padding: 10px;
text-decoration:none;
}
#aznavbar a:active{
color:#FA6405;
font-family:Verdana,Geneva,'DejaVu Sans',sans-serif;
padding: 10px;
text-decoration:none;
}
#aznavbar {
background: #141414;
background: -moz-linear-gradient(top, #32323a 0%, #141414 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #32323a), color-stop(100%, #141414));
background: -webkit-linear-gradient(top, #32323a 0%, #141414 100%);
background: -o-linear-gradient(top, #32323a 0%, #141414 100%);
background: -ms-linear-gradient(top, #32323a 0%, #141414 100%);
background: linear-gradient(to bottom, #32323a 0%, #141414 100%);
filter: progid:DXImageTransform.Microsoft.Gradient(StartColorStr='#32323a', EndColorStr='#141414', GradientType=0);
border: 1px solid #000;
margin: -10px 0px 0px -8px;
padding: 10 0px 10px 80px;
width: 94.8%;
}
a:hover#showall {
}
#ad-wrapper{
margin:0px auto 0px auto;
text-align:center;
}
</style>
</head>
<body>
<?php include('az.php'); ?>
<div class="drop-shadow lifted" id="header"><img src="/test2/images/logo.png" alt="Reunite My Site - Company Logo" title="Reunite My Site - Company Logo"> </div>
<div id="login">Login: <input type="username" class="login" size="20px;">
<br />
Password: <input class="login" type="password" size="20px">
<br />
Remember Me? <input type="checkbox">
<a href="#">Register Now For Free!</a>
<div class="note orange rounded">Start your Advertising or Publishing Campaign Now by simply clicking the Register Now button above!</div></div>
<iframe name="frame">Sorry, you need the newest browser to display iframes!</iframe>
</body>
</html>
- <html>
- <head> <title> </title>
- <meta name="viewport" content="initial-scale=1.0">
- <link rel="stylesheet" type="text/css" href="css/breadcrumb.css" media="screen" charset="utf-8" />
- <link rel="stylesheet" type="text/css" href="css/default.css" media="screen" charset="utf-8" />
- <link rel="stylesheet" type="text/css" href="css/menu.css" media="screen" charset="utf-8" />
- <style media="screen" type="text/css">
- html, body { }
- #aznavbar a:link {
- color: #0C7FB0;
- font-family:Verdana,Geneva,'DejaVu Sans',sans-serif;
- margin-left: 4.15px;
- padding: 10px;
- text-decoration:none;
- }
- #aznavbar a:visited {
- color: #0C7FB0;
- font-family:Verdana,Geneva,'DejaVu Sans',sans-serif;
- padding: 10px;
- text-decoration:none;
- }
- #aznavbar a:hover {
- background-color: #FA6405;
- color:#000;
- font-family:Verdana,Geneva,'DejaVu Sans',sans-serif;
- padding: 10px;
- text-decoration:none;
- }
- #aznavbar a:active{
- color:#FA6405;
- font-family:Verdana,Geneva,'DejaVu Sans',sans-serif;
- padding: 10px;
- text-decoration:none;
- }
- #aznavbar {
- background: #141414;
- background: -moz-linear-gradient(top, #32323a 0%, #141414 100%);
- background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #32323a), color-stop(100%, #141414));
- background: -webkit-linear-gradient(top, #32323a 0%, #141414 100%);
- background: -o-linear-gradient(top, #32323a 0%, #141414 100%);
- background: -ms-linear-gradient(top, #32323a 0%, #141414 100%);
- background: linear-gradient(to bottom, #32323a 0%, #141414 100%);
- filter: progid:DXImageTransform.Microsoft.Gradient(StartColorStr='#32323a', EndColorStr='#141414', GradientType=0);
- border: 1px solid #000;
- margin: -10px 0px 0px -8px;
- padding: 10 0px 10px 80px;
- width: 94.8%;
- }
- a:hover#showall {
- }
- #ad-wrapper{
- margin:0px auto 0px auto;
- text-align:center;
- }
- </style>
- </head>
- <body>
- <?php include('az.php'); ?>
- <div class="drop-shadow lifted" id="header"><img src="/test2/images/logo.png" alt="Reunite My Site - Company Logo" title="Reunite My Site - Company Logo"> </div>
- <div id="login">Login: <input type="username" class="login" size="20px;">
- <br />
- Password: <input class="login" type="password" size="20px">
- <br />
- Remember Me? <input type="checkbox">
- <a href="#">Register Now For Free!</a>
- <div class="note orange rounded">Start your Advertising or Publishing Campaign Now by simply clicking the Register Now button above!</div></div>
- <iframe name="frame">Sorry, you need the newest browser to display iframes!</iframe>
- </body>
- </html>
AZ.php
PHP Code: [ Select ]
<div id="aznavbar" class="drop-shadow raised">
<?php
//This creates the menu at the top A-Z
$char = $_GET['letter'];
$list="num";
foreach (range('A', 'Z') as $i) $list.=",$i";
$list.=",Show All Ads";
$a = explode(',', $list);
foreach ($a as $b) {
if (!empty($b)) {
if ($b=="num") {
if ($char=="num") echo "<a href=\"results.php?letter=num\" target=\"frame\">#</a>";
else echo "<a href=\"results.php?letter=num\" target=\"frame\">#</a>";
}
elseif ($b=="Show All Ads") {
if (($char=="*")||(empty($char))) echo "<a href=\"results.php?letter=*\" target=\"frame\">Show All Ads</a>";
else echo "<a href=\"results.php?letter=*\" target=\"frame\">Show All Ads</a>";
}
elseif($b==$char) echo "<a href=\"results.php?letter=".$b."\" target=\"frame\">$b</a>";
else echo "<a href=\"results.php?letter=".$b."\" target=\"frame\">$b</a>";
}
}
?>
</div>
<?php
//This creates the menu at the top A-Z
$char = $_GET['letter'];
$list="num";
foreach (range('A', 'Z') as $i) $list.=",$i";
$list.=",Show All Ads";
$a = explode(',', $list);
foreach ($a as $b) {
if (!empty($b)) {
if ($b=="num") {
if ($char=="num") echo "<a href=\"results.php?letter=num\" target=\"frame\">#</a>";
else echo "<a href=\"results.php?letter=num\" target=\"frame\">#</a>";
}
elseif ($b=="Show All Ads") {
if (($char=="*")||(empty($char))) echo "<a href=\"results.php?letter=*\" target=\"frame\">Show All Ads</a>";
else echo "<a href=\"results.php?letter=*\" target=\"frame\">Show All Ads</a>";
}
elseif($b==$char) echo "<a href=\"results.php?letter=".$b."\" target=\"frame\">$b</a>";
else echo "<a href=\"results.php?letter=".$b."\" target=\"frame\">$b</a>";
}
}
?>
</div>
- <div id="aznavbar" class="drop-shadow raised">
- <?php
- //This creates the menu at the top A-Z
- $char = $_GET['letter'];
- $list="num";
- foreach (range('A', 'Z') as $i) $list.=",$i";
- $list.=",Show All Ads";
- $a = explode(',', $list);
- foreach ($a as $b) {
- if (!empty($b)) {
- if ($b=="num") {
- if ($char=="num") echo "<a href=\"results.php?letter=num\" target=\"frame\">#</a>";
- else echo "<a href=\"results.php?letter=num\" target=\"frame\">#</a>";
- }
- elseif ($b=="Show All Ads") {
- if (($char=="*")||(empty($char))) echo "<a href=\"results.php?letter=*\" target=\"frame\">Show All Ads</a>";
- else echo "<a href=\"results.php?letter=*\" target=\"frame\">Show All Ads</a>";
- }
- elseif($b==$char) echo "<a href=\"results.php?letter=".$b."\" target=\"frame\">$b</a>";
- else echo "<a href=\"results.php?letter=".$b."\" target=\"frame\">$b</a>";
- }
- }
- ?>
- </div>
Results.php
PHP Code: [ Select ]
<?php
// How many adjacent pages should be shown on each side?
$adjacents = 1; //This only applies to lists that are more then 8 pages (controls the ...'s not the list)
//how many items to show per page
$limit = 10;
//Number of ads per row
$rows = 3;
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
<title>A To Z AD Navigation </title>
<style media="screen" type="text/css">
html, body { }
#aznavbar a:link {
color: #0C7FB0;
font-family:Verdana,Geneva,'DejaVu Sans',sans-serif;
margin-left: 4.15px;
padding: 10px;
text-decoration:none;
}
#aznavbar a:visited {
color: #0C7FB0;
font-family:Verdana,Geneva,'DejaVu Sans',sans-serif;
padding: 10px;
text-decoration:none;
}
#aznavbar a:hover {
background-color: #FA6405;
color:#000;
font-family:Verdana,Geneva,'DejaVu Sans',sans-serif;
padding: 10px;
text-decoration:none;
}
#aznavbar a:active{
color:#FA6405;
font-family:Verdana,Geneva,'DejaVu Sans',sans-serif;
padding: 10px;
text-decoration:none;
}
#aznavbar {
background: #141414;
background: -moz-linear-gradient(top, #32323a 0%, #141414 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #32323a), color-stop(100%, #141414));
background: -webkit-linear-gradient(top, #32323a 0%, #141414 100%);
background: -o-linear-gradient(top, #32323a 0%, #141414 100%);
background: -ms-linear-gradient(top, #32323a 0%, #141414 100%);
background: linear-gradient(to bottom, #32323a 0%, #141414 100%);
filter: progid:DXImageTransform.Microsoft.Gradient(StartColorStr='#32323a', EndColorStr='#141414', GradientType=0);
border: 1px solid #000;
margin: -10px 0px 0px -8px;
padding: 10 0px 10px 80px;
width: 94.8%;
}
a:hover#showall {
}
#ad-wrapper{
margin:0px auto 0px auto;
text-align:center;
}
</style>
</head>
<body>
<?php
//This creates the menu at the top A-Z
$char = $_GET['letter'];
$list="num";
if(!empty($char)){
include('connect.php');
$tbl_name="amp_ads"; //your table name
/*
First get total number of rows in data table.
If you have a WHERE clause in your query, make sure you mirror it here.
*/
if((empty($char))||($char=="*")) $query = "SELECT COUNT(*) as num FROM $tbl_name";
elseif($char=="num") $query = "SELECT COUNT(*) as num FROM $tbl_name WHERE title REGEXP '^[0-9]'";
else $query = "SELECT COUNT(*) as num FROM $tbl_name WHERE title LIKE '$char%'";
$total_pages = mysql_fetch_array(mysql_query($query));
$total_pages = $total_pages[num];
/* Setup vars for query. */
if(!empty($char)) $targetpage = "results.php?letter=$char&";
else $targetpage = "az.php?"; //your file name (the name of this file)
$page = $_GET['page'];
if($page)
$start = ($page - 1) * $limit; //first item to display on this page
else
$start = 0; //if no page var is given, set start to 0
/* Get data. */
if($char=="*") $sql = "SELECT * FROM $tbl_name LIMIT $start, $limit";
elseif($char=="num") $sql = "SELECT * FROM $tbl_name WHERE title REGEXP '^[0-9]' LIMIT $start, $limit";
else $sql = "SELECT * FROM $tbl_name WHERE title LIKE '$char%' LIMIT $start, $limit";
$result = mysql_query($sql);
/* Setup page vars for display. */
if ($page == 0) $page = 1; //if no page var is given, default to 1.
$prev = $page - 1; //previous page is page - 1
$next = $page + 1; //next page is page + 1
$lastpage = ceil($total_pages/$limit); //lastpage is = total pages / items per page, rounded up.
$lpm1 = $lastpage - 1; //last page minus 1
/*
Now we apply our rules and draw the pagination object.
We're actually saving the code to a variable in case we want to draw it more than once.
*/
$pagination = "";
if($lastpage > 1)
{
$pagination .= "<div class=\"pagination\">";
//previous button
if ($page > 1)
$pagination.= "<a href=\"$targetpage"."page=$prev\">« previous </a>";
else
$pagination.= "<span class=\"disabled\">« previous </span>";
//pages
if ($lastpage < 7 + ($adjacents * 2)) //not enough pages to bother breaking it up
{
for ($counter = 1; $counter <= $lastpage; $counter++)
{
if ($counter == $page)
$pagination.= "<span class=\"current\">$counter</span>";
else
$pagination.= "<a href=\"$targetpage"."page=$counter\">$counter</a>";
}
}
elseif($lastpage > 5 + ($adjacents * 2)) //enough pages to hide some
{
//close to beginning; only hide later pages
if($page < 1 + ($adjacents * 2))
{
for ($counter = 1; $counter < 4 + ($adjacents * 2); $counter++)
{
if ($counter == $page)
$pagination.= "<span class=\"current\">$counter</span>";
else
$pagination.= "<a href=\"$targetpage"."page=$counter\">$counter</a>";
}
$pagination.= "...";
$pagination.= "<a href=\"$targetpage"."page=$lpm1\">$lpm1</a>";
$pagination.= "<a href=\"$targetpage"."page=$lastpage\">$lastpage</a>";
}
//in middle; hide some front and some back
elseif($lastpage - ($adjacents * 2) > $page && $page > ($adjacents * 2))
{
$pagination.= "<a href=\"$targetpage"."page=1\">1</a>";
$pagination.= "<a href=\"$targetpage"."page=2\">2</a>";
$pagination.= "...";
for ($counter = $page - $adjacents; $counter <= $page + $adjacents; $counter++)
{
if ($counter == $page)
$pagination.= "<span class=\"current\">$counter</span>";
else
$pagination.= "<a href=\"$targetpage"."page=$counter\">$counter</a>";
}
$pagination.= "...";
$pagination.= "<a href=\"$targetpage"."page=$lpm1\">$lpm1</a>";
$pagination.= "<a href=\"$targetpage"."page=$lastpage\">$lastpage</a>";
}
//close to end; only hide early pages
else
{
$pagination.= "<a href=\"$targetpage"."page=1\">1</a>";
$pagination.= "<a href=\"$targetpage"."page=2\">2</a>";
$pagination.= "...";
for ($counter = $lastpage - (2 + ($adjacents * 2)); $counter <= $lastpage; $counter++)
{
if ($counter == $page)
$pagination.= "<span class=\"current\">$counter</span>";
else
$pagination.= "<a href=\"$targetpage"."page=$counter\">$counter</a>";
}
}
}
//next button
if ($page < $counter - 1)
$pagination.= "<a href=\"$targetpage"."page=$next\"> next »</a>";
else
$pagination.= "<span class=\"disabled\"> next »</span>";
$pagination.= "</div>\n";
}
?>
<?php
echo '<div id="ad-wrapper">';
if($total_pages==0) echo "No Results for ".$char."!";
else{
$c = -1;
while($row = mysql_fetch_array($result))
{
if($c%$rows==$rows-1) echo "<br/>";
echo "<a href=\"details.php?id=$row[n] \"><img class=\"ads\" alt=\"$row[alt]\" title=\"$row[alt]\" src=\"$row[banner]\"><p /> $row[alt]";
$c++;
$c++;
}
}
}
?>
<?php echo $pagination ?>
</body>
</html>
// How many adjacent pages should be shown on each side?
$adjacents = 1; //This only applies to lists that are more then 8 pages (controls the ...'s not the list)
//how many items to show per page
$limit = 10;
//Number of ads per row
$rows = 3;
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
<title>A To Z AD Navigation </title>
<style media="screen" type="text/css">
html, body { }
#aznavbar a:link {
color: #0C7FB0;
font-family:Verdana,Geneva,'DejaVu Sans',sans-serif;
margin-left: 4.15px;
padding: 10px;
text-decoration:none;
}
#aznavbar a:visited {
color: #0C7FB0;
font-family:Verdana,Geneva,'DejaVu Sans',sans-serif;
padding: 10px;
text-decoration:none;
}
#aznavbar a:hover {
background-color: #FA6405;
color:#000;
font-family:Verdana,Geneva,'DejaVu Sans',sans-serif;
padding: 10px;
text-decoration:none;
}
#aznavbar a:active{
color:#FA6405;
font-family:Verdana,Geneva,'DejaVu Sans',sans-serif;
padding: 10px;
text-decoration:none;
}
#aznavbar {
background: #141414;
background: -moz-linear-gradient(top, #32323a 0%, #141414 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #32323a), color-stop(100%, #141414));
background: -webkit-linear-gradient(top, #32323a 0%, #141414 100%);
background: -o-linear-gradient(top, #32323a 0%, #141414 100%);
background: -ms-linear-gradient(top, #32323a 0%, #141414 100%);
background: linear-gradient(to bottom, #32323a 0%, #141414 100%);
filter: progid:DXImageTransform.Microsoft.Gradient(StartColorStr='#32323a', EndColorStr='#141414', GradientType=0);
border: 1px solid #000;
margin: -10px 0px 0px -8px;
padding: 10 0px 10px 80px;
width: 94.8%;
}
a:hover#showall {
}
#ad-wrapper{
margin:0px auto 0px auto;
text-align:center;
}
</style>
</head>
<body>
<?php
//This creates the menu at the top A-Z
$char = $_GET['letter'];
$list="num";
if(!empty($char)){
include('connect.php');
$tbl_name="amp_ads"; //your table name
/*
First get total number of rows in data table.
If you have a WHERE clause in your query, make sure you mirror it here.
*/
if((empty($char))||($char=="*")) $query = "SELECT COUNT(*) as num FROM $tbl_name";
elseif($char=="num") $query = "SELECT COUNT(*) as num FROM $tbl_name WHERE title REGEXP '^[0-9]'";
else $query = "SELECT COUNT(*) as num FROM $tbl_name WHERE title LIKE '$char%'";
$total_pages = mysql_fetch_array(mysql_query($query));
$total_pages = $total_pages[num];
/* Setup vars for query. */
if(!empty($char)) $targetpage = "results.php?letter=$char&";
else $targetpage = "az.php?"; //your file name (the name of this file)
$page = $_GET['page'];
if($page)
$start = ($page - 1) * $limit; //first item to display on this page
else
$start = 0; //if no page var is given, set start to 0
/* Get data. */
if($char=="*") $sql = "SELECT * FROM $tbl_name LIMIT $start, $limit";
elseif($char=="num") $sql = "SELECT * FROM $tbl_name WHERE title REGEXP '^[0-9]' LIMIT $start, $limit";
else $sql = "SELECT * FROM $tbl_name WHERE title LIKE '$char%' LIMIT $start, $limit";
$result = mysql_query($sql);
/* Setup page vars for display. */
if ($page == 0) $page = 1; //if no page var is given, default to 1.
$prev = $page - 1; //previous page is page - 1
$next = $page + 1; //next page is page + 1
$lastpage = ceil($total_pages/$limit); //lastpage is = total pages / items per page, rounded up.
$lpm1 = $lastpage - 1; //last page minus 1
/*
Now we apply our rules and draw the pagination object.
We're actually saving the code to a variable in case we want to draw it more than once.
*/
$pagination = "";
if($lastpage > 1)
{
$pagination .= "<div class=\"pagination\">";
//previous button
if ($page > 1)
$pagination.= "<a href=\"$targetpage"."page=$prev\">« previous </a>";
else
$pagination.= "<span class=\"disabled\">« previous </span>";
//pages
if ($lastpage < 7 + ($adjacents * 2)) //not enough pages to bother breaking it up
{
for ($counter = 1; $counter <= $lastpage; $counter++)
{
if ($counter == $page)
$pagination.= "<span class=\"current\">$counter</span>";
else
$pagination.= "<a href=\"$targetpage"."page=$counter\">$counter</a>";
}
}
elseif($lastpage > 5 + ($adjacents * 2)) //enough pages to hide some
{
//close to beginning; only hide later pages
if($page < 1 + ($adjacents * 2))
{
for ($counter = 1; $counter < 4 + ($adjacents * 2); $counter++)
{
if ($counter == $page)
$pagination.= "<span class=\"current\">$counter</span>";
else
$pagination.= "<a href=\"$targetpage"."page=$counter\">$counter</a>";
}
$pagination.= "...";
$pagination.= "<a href=\"$targetpage"."page=$lpm1\">$lpm1</a>";
$pagination.= "<a href=\"$targetpage"."page=$lastpage\">$lastpage</a>";
}
//in middle; hide some front and some back
elseif($lastpage - ($adjacents * 2) > $page && $page > ($adjacents * 2))
{
$pagination.= "<a href=\"$targetpage"."page=1\">1</a>";
$pagination.= "<a href=\"$targetpage"."page=2\">2</a>";
$pagination.= "...";
for ($counter = $page - $adjacents; $counter <= $page + $adjacents; $counter++)
{
if ($counter == $page)
$pagination.= "<span class=\"current\">$counter</span>";
else
$pagination.= "<a href=\"$targetpage"."page=$counter\">$counter</a>";
}
$pagination.= "...";
$pagination.= "<a href=\"$targetpage"."page=$lpm1\">$lpm1</a>";
$pagination.= "<a href=\"$targetpage"."page=$lastpage\">$lastpage</a>";
}
//close to end; only hide early pages
else
{
$pagination.= "<a href=\"$targetpage"."page=1\">1</a>";
$pagination.= "<a href=\"$targetpage"."page=2\">2</a>";
$pagination.= "...";
for ($counter = $lastpage - (2 + ($adjacents * 2)); $counter <= $lastpage; $counter++)
{
if ($counter == $page)
$pagination.= "<span class=\"current\">$counter</span>";
else
$pagination.= "<a href=\"$targetpage"."page=$counter\">$counter</a>";
}
}
}
//next button
if ($page < $counter - 1)
$pagination.= "<a href=\"$targetpage"."page=$next\"> next »</a>";
else
$pagination.= "<span class=\"disabled\"> next »</span>";
$pagination.= "</div>\n";
}
?>
<?php
echo '<div id="ad-wrapper">';
if($total_pages==0) echo "No Results for ".$char."!";
else{
$c = -1;
while($row = mysql_fetch_array($result))
{
if($c%$rows==$rows-1) echo "<br/>";
echo "<a href=\"details.php?id=$row[n] \"><img class=\"ads\" alt=\"$row[alt]\" title=\"$row[alt]\" src=\"$row[banner]\"><p /> $row[alt]";
$c++;
$c++;
}
}
}
?>
<?php echo $pagination ?>
</body>
</html>
- <?php
- // How many adjacent pages should be shown on each side?
- $adjacents = 1; //This only applies to lists that are more then 8 pages (controls the ...'s not the list)
- //how many items to show per page
- $limit = 10;
- //Number of ads per row
- $rows = 3;
- ?>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
- <head>
- <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
- <title>A To Z AD Navigation </title>
- <style media="screen" type="text/css">
- html, body { }
- #aznavbar a:link {
- color: #0C7FB0;
- font-family:Verdana,Geneva,'DejaVu Sans',sans-serif;
- margin-left: 4.15px;
- padding: 10px;
- text-decoration:none;
- }
- #aznavbar a:visited {
- color: #0C7FB0;
- font-family:Verdana,Geneva,'DejaVu Sans',sans-serif;
- padding: 10px;
- text-decoration:none;
- }
- #aznavbar a:hover {
- background-color: #FA6405;
- color:#000;
- font-family:Verdana,Geneva,'DejaVu Sans',sans-serif;
- padding: 10px;
- text-decoration:none;
- }
- #aznavbar a:active{
- color:#FA6405;
- font-family:Verdana,Geneva,'DejaVu Sans',sans-serif;
- padding: 10px;
- text-decoration:none;
- }
- #aznavbar {
- background: #141414;
- background: -moz-linear-gradient(top, #32323a 0%, #141414 100%);
- background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #32323a), color-stop(100%, #141414));
- background: -webkit-linear-gradient(top, #32323a 0%, #141414 100%);
- background: -o-linear-gradient(top, #32323a 0%, #141414 100%);
- background: -ms-linear-gradient(top, #32323a 0%, #141414 100%);
- background: linear-gradient(to bottom, #32323a 0%, #141414 100%);
- filter: progid:DXImageTransform.Microsoft.Gradient(StartColorStr='#32323a', EndColorStr='#141414', GradientType=0);
- border: 1px solid #000;
- margin: -10px 0px 0px -8px;
- padding: 10 0px 10px 80px;
- width: 94.8%;
- }
- a:hover#showall {
- }
- #ad-wrapper{
- margin:0px auto 0px auto;
- text-align:center;
- }
- </style>
- </head>
- <body>
- <?php
- //This creates the menu at the top A-Z
- $char = $_GET['letter'];
- $list="num";
- if(!empty($char)){
- include('connect.php');
- $tbl_name="amp_ads"; //your table name
- /*
- First get total number of rows in data table.
- If you have a WHERE clause in your query, make sure you mirror it here.
- */
- if((empty($char))||($char=="*")) $query = "SELECT COUNT(*) as num FROM $tbl_name";
- elseif($char=="num") $query = "SELECT COUNT(*) as num FROM $tbl_name WHERE title REGEXP '^[0-9]'";
- else $query = "SELECT COUNT(*) as num FROM $tbl_name WHERE title LIKE '$char%'";
- $total_pages = mysql_fetch_array(mysql_query($query));
- $total_pages = $total_pages[num];
- /* Setup vars for query. */
- if(!empty($char)) $targetpage = "results.php?letter=$char&";
- else $targetpage = "az.php?"; //your file name (the name of this file)
- $page = $_GET['page'];
- if($page)
- $start = ($page - 1) * $limit; //first item to display on this page
- else
- $start = 0; //if no page var is given, set start to 0
- /* Get data. */
- if($char=="*") $sql = "SELECT * FROM $tbl_name LIMIT $start, $limit";
- elseif($char=="num") $sql = "SELECT * FROM $tbl_name WHERE title REGEXP '^[0-9]' LIMIT $start, $limit";
- else $sql = "SELECT * FROM $tbl_name WHERE title LIKE '$char%' LIMIT $start, $limit";
- $result = mysql_query($sql);
- /* Setup page vars for display. */
- if ($page == 0) $page = 1; //if no page var is given, default to 1.
- $prev = $page - 1; //previous page is page - 1
- $next = $page + 1; //next page is page + 1
- $lastpage = ceil($total_pages/$limit); //lastpage is = total pages / items per page, rounded up.
- $lpm1 = $lastpage - 1; //last page minus 1
- /*
- Now we apply our rules and draw the pagination object.
- We're actually saving the code to a variable in case we want to draw it more than once.
- */
- $pagination = "";
- if($lastpage > 1)
- {
- $pagination .= "<div class=\"pagination\">";
- //previous button
- if ($page > 1)
- $pagination.= "<a href=\"$targetpage"."page=$prev\">« previous </a>";
- else
- $pagination.= "<span class=\"disabled\">« previous </span>";
- //pages
- if ($lastpage < 7 + ($adjacents * 2)) //not enough pages to bother breaking it up
- {
- for ($counter = 1; $counter <= $lastpage; $counter++)
- {
- if ($counter == $page)
- $pagination.= "<span class=\"current\">$counter</span>";
- else
- $pagination.= "<a href=\"$targetpage"."page=$counter\">$counter</a>";
- }
- }
- elseif($lastpage > 5 + ($adjacents * 2)) //enough pages to hide some
- {
- //close to beginning; only hide later pages
- if($page < 1 + ($adjacents * 2))
- {
- for ($counter = 1; $counter < 4 + ($adjacents * 2); $counter++)
- {
- if ($counter == $page)
- $pagination.= "<span class=\"current\">$counter</span>";
- else
- $pagination.= "<a href=\"$targetpage"."page=$counter\">$counter</a>";
- }
- $pagination.= "...";
- $pagination.= "<a href=\"$targetpage"."page=$lpm1\">$lpm1</a>";
- $pagination.= "<a href=\"$targetpage"."page=$lastpage\">$lastpage</a>";
- }
- //in middle; hide some front and some back
- elseif($lastpage - ($adjacents * 2) > $page && $page > ($adjacents * 2))
- {
- $pagination.= "<a href=\"$targetpage"."page=1\">1</a>";
- $pagination.= "<a href=\"$targetpage"."page=2\">2</a>";
- $pagination.= "...";
- for ($counter = $page - $adjacents; $counter <= $page + $adjacents; $counter++)
- {
- if ($counter == $page)
- $pagination.= "<span class=\"current\">$counter</span>";
- else
- $pagination.= "<a href=\"$targetpage"."page=$counter\">$counter</a>";
- }
- $pagination.= "...";
- $pagination.= "<a href=\"$targetpage"."page=$lpm1\">$lpm1</a>";
- $pagination.= "<a href=\"$targetpage"."page=$lastpage\">$lastpage</a>";
- }
- //close to end; only hide early pages
- else
- {
- $pagination.= "<a href=\"$targetpage"."page=1\">1</a>";
- $pagination.= "<a href=\"$targetpage"."page=2\">2</a>";
- $pagination.= "...";
- for ($counter = $lastpage - (2 + ($adjacents * 2)); $counter <= $lastpage; $counter++)
- {
- if ($counter == $page)
- $pagination.= "<span class=\"current\">$counter</span>";
- else
- $pagination.= "<a href=\"$targetpage"."page=$counter\">$counter</a>";
- }
- }
- }
- //next button
- if ($page < $counter - 1)
- $pagination.= "<a href=\"$targetpage"."page=$next\"> next »</a>";
- else
- $pagination.= "<span class=\"disabled\"> next »</span>";
- $pagination.= "</div>\n";
- }
- ?>
- <?php
- echo '<div id="ad-wrapper">';
- if($total_pages==0) echo "No Results for ".$char."!";
- else{
- $c = -1;
- while($row = mysql_fetch_array($result))
- {
- if($c%$rows==$rows-1) echo "<br/>";
- echo "<a href=\"details.php?id=$row[n] \"><img class=\"ads\" alt=\"$row[alt]\" title=\"$row[alt]\" src=\"$row[banner]\"><p /> $row[alt]";
- $c++;
- $c++;
- }
- }
- }
- ?>
- <?php echo $pagination ?>
- </body>
- </html>
- Brian Jester
- Beginner


- Inscription: Jan 06, 2006
- Messages: 61
- Loc: Bayonne, New Jersey USA
- Status: Offline
- ScottG
- Proficient


- Inscription: Juil 06, 2010
- Messages: 260
- Status: Offline
- Brian Jester
- Beginner


- Inscription: Jan 06, 2006
- Messages: 61
- Loc: Bayonne, New Jersey USA
- Status: Offline
Salut Scott,
Hate de vous déranger, et je n'ai pas * pense ** sa que les grandes d'un accord pour le faire, mais au lieu d'ouverture dans l'iframe, pouvez-vous m'aider Ouvrez-le dans la div php "switch" ? Motif : La hauteur de l'iframe, je pense que vous savez le reste...Dont vous souhaitez utiliser javascript pour quelque chose comme ça.
Heres un peu de code de « switch » qui fonctionne :
<style type="text/css">
#target {
width: 300px;
height: 300px;
background-color: #00FFCC;
border: 1px solid #000;
text-align: center;
vertical-align:middle;
margin: 0 auto;
padding: 10px; }
</style>
<body>
<a href="index.php?page=main">page1</a>
<a href="index.php?page=2"><br />page2</a>
<a href="index.php?page=3"><br />page3</a>
<p />
<div id="target">
<?php
switch ($_GET['page'])
{
case "main": include '1.php'; break;
case "2": include '2.php'; break;
case "3": include '3.php'; break;
default: include '1.php';
}
?>
</div>
</body>
</html>
Hate de vous déranger, et je n'ai pas * pense ** sa que les grandes d'un accord pour le faire, mais au lieu d'ouverture dans l'iframe, pouvez-vous m'aider Ouvrez-le dans la div php "switch" ? Motif : La hauteur de l'iframe, je pense que vous savez le reste...Dont vous souhaitez utiliser javascript pour quelque chose comme ça.
Heres un peu de code de « switch » qui fonctionne :
Code: [ Select ]
<style type="text/css">
#target {
width: 300px;
height: 300px;
background-color: #00FFCC;
border: 1px solid #000;
text-align: center;
vertical-align:middle;
margin: 0 auto;
padding: 10px; }
</style>
<body>
<a href="index.php?page=main">page1</a>
<a href="index.php?page=2"><br />page2</a>
<a href="index.php?page=3"><br />page3</a>
<p />
<div id="target">
<?php
switch ($_GET['page'])
{
case "main": include '1.php'; break;
case "2": include '2.php'; break;
case "3": include '3.php'; break;
default: include '1.php';
}
?>
</div>
</body>
</html>
- <style type="text/css">
- #target {
- width: 300px;
- height: 300px;
- background-color: #00FFCC;
- border: 1px solid #000;
- text-align: center;
- vertical-align:middle;
- margin: 0 auto;
- padding: 10px; }
- </style>
- <body>
- <a href="index.php?page=main">page1</a>
- <a href="index.php?page=2"><br />page2</a>
- <a href="index.php?page=3"><br />page3</a>
- <p />
- <div id="target">
- <?php
- switch ($_GET['page'])
- {
- case "main": include '1.php'; break;
- case "2": include '2.php'; break;
- case "3": include '3.php'; break;
- default: include '1.php';
- }
- ?>
- </div>
- </body>
- </html>
- ScottG
- Proficient


- Inscription: Juil 06, 2010
- Messages: 260
- Status: Offline
Vous devriez être en mesure de changer le results.php à cette
et il suffit d'inclure dans la balise div
Si Im ne me trompé les résultats page retourne nothing si les variables ne sont pas le programme d'installation.
PHP Code: [ Select ]
<?php
// How many adjacent pages should be shown on each side?
$adjacents = 1; //This only applies to lists that are more then 8 pages (controls the ...'s not the list)
//how many items to show per page
$limit = 10;
//Number of ads per row
$rows = 3;
//This creates the menu at the top A-Z
$char = $_GET['letter'];
$list="num";
if(!empty($char)){
include('connect.php');
$tbl_name="amp_ads"; //your table name
/*
First get total number of rows in data table.
If you have a WHERE clause in your query, make sure you mirror it here.
*/
if((empty($char))||($char=="*")) $query = "SELECT COUNT(*) as num FROM $tbl_name";
elseif($char=="num") $query = "SELECT COUNT(*) as num FROM $tbl_name WHERE title REGEXP '^[0-9]'";
else $query = "SELECT COUNT(*) as num FROM $tbl_name WHERE title LIKE '$char%'";
$total_pages = mysql_fetch_array(mysql_query($query));
$total_pages = $total_pages[num];
/* Setup vars for query. */
if(!empty($char)) $targetpage = "results.php?letter=$char&";
else $targetpage = "az.php?"; //your file name (the name of this file)
$page = $_GET['page'];
if($page)
$start = ($page - 1) * $limit; //first item to display on this page
else
$start = 0; //if no page var is given, set start to 0
/* Get data. */
if($char=="*") $sql = "SELECT * FROM $tbl_name LIMIT $start, $limit";
elseif($char=="num") $sql = "SELECT * FROM $tbl_name WHERE title REGEXP '^[0-9]' LIMIT $start, $limit";
else $sql = "SELECT * FROM $tbl_name WHERE title LIKE '$char%' LIMIT $start, $limit";
$result = mysql_query($sql);
/* Setup page vars for display. */
if ($page == 0) $page = 1; //if no page var is given, default to 1.
$prev = $page - 1; //previous page is page - 1
$next = $page + 1; //next page is page + 1
$lastpage = ceil($total_pages/$limit); //lastpage is = total pages / items per page, rounded up.
$lpm1 = $lastpage - 1; //last page minus 1
/*
Now we apply our rules and draw the pagination object.
We're actually saving the code to a variable in case we want to draw it more than once.
*/
$pagination = "";
if($lastpage > 1)
{
$pagination .= "<div class=\"pagination\">";
//previous button
if ($page > 1)
$pagination.= "<a href=\"$targetpage"."page=$prev\">« previous </a>";
else
$pagination.= "<span class=\"disabled\">« previous </span>";
//pages
if ($lastpage < 7 + ($adjacents * 2)) //not enough pages to bother breaking it up
{
for ($counter = 1; $counter <= $lastpage; $counter++)
{
if ($counter == $page)
$pagination.= "<span class=\"current\">$counter</span>";
else
$pagination.= "<a href=\"$targetpage"."page=$counter\">$counter</a>";
}
}
elseif($lastpage > 5 + ($adjacents * 2)) //enough pages to hide some
{
//close to beginning; only hide later pages
if($page < 1 + ($adjacents * 2))
{
for ($counter = 1; $counter < 4 + ($adjacents * 2); $counter++)
{
if ($counter == $page)
$pagination.= "<span class=\"current\">$counter</span>";
else
$pagination.= "<a href=\"$targetpage"."page=$counter\">$counter</a>";
}
$pagination.= "...";
$pagination.= "<a href=\"$targetpage"."page=$lpm1\">$lpm1</a>";
$pagination.= "<a href=\"$targetpage"."page=$lastpage\">$lastpage</a>";
}
//in middle; hide some front and some back
elseif($lastpage - ($adjacents * 2) > $page && $page > ($adjacents * 2))
{
$pagination.= "<a href=\"$targetpage"."page=1\">1</a>";
$pagination.= "<a href=\"$targetpage"."page=2\">2</a>";
$pagination.= "...";
for ($counter = $page - $adjacents; $counter <= $page + $adjacents; $counter++)
{
if ($counter == $page)
$pagination.= "<span class=\"current\">$counter</span>";
else
$pagination.= "<a href=\"$targetpage"."page=$counter\">$counter</a>";
}
$pagination.= "...";
$pagination.= "<a href=\"$targetpage"."page=$lpm1\">$lpm1</a>";
$pagination.= "<a href=\"$targetpage"."page=$lastpage\">$lastpage</a>";
}
//close to end; only hide early pages
else
{
$pagination.= "<a href=\"$targetpage"."page=1\">1</a>";
$pagination.= "<a href=\"$targetpage"."page=2\">2</a>";
$pagination.= "...";
for ($counter = $lastpage - (2 + ($adjacents * 2)); $counter <= $lastpage; $counter++)
{
if ($counter == $page)
$pagination.= "<span class=\"current\">$counter</span>";
else
$pagination.= "<a href=\"$targetpage"."page=$counter\">$counter</a>";
}
}
}
//next button
if ($page < $counter - 1)
$pagination.= "<a href=\"$targetpage"."page=$next\"> next »</a>";
else
$pagination.= "<span class=\"disabled\"> next »</span>";
$pagination.= "</div>\n";
}
echo '<div id="ad-wrapper">';
if($total_pages==0) echo "No Results for ".$char."!";
else{
$c = -1;
while($row = mysql_fetch_array($result))
{
if($c%$rows==$rows-1) echo "<br/>";
echo "<a href=\"details.php?id=$row[n] \"><img class=\"ads\" alt=\"$row[alt]\" title=\"$row[alt]\" src=\"$row[banner]\"><p /> $row[alt]";
$c++;
$c++;
}
}
}
echo $pagination;
?>
// How many adjacent pages should be shown on each side?
$adjacents = 1; //This only applies to lists that are more then 8 pages (controls the ...'s not the list)
//how many items to show per page
$limit = 10;
//Number of ads per row
$rows = 3;
//This creates the menu at the top A-Z
$char = $_GET['letter'];
$list="num";
if(!empty($char)){
include('connect.php');
$tbl_name="amp_ads"; //your table name
/*
First get total number of rows in data table.
If you have a WHERE clause in your query, make sure you mirror it here.
*/
if((empty($char))||($char=="*")) $query = "SELECT COUNT(*) as num FROM $tbl_name";
elseif($char=="num") $query = "SELECT COUNT(*) as num FROM $tbl_name WHERE title REGEXP '^[0-9]'";
else $query = "SELECT COUNT(*) as num FROM $tbl_name WHERE title LIKE '$char%'";
$total_pages = mysql_fetch_array(mysql_query($query));
$total_pages = $total_pages[num];
/* Setup vars for query. */
if(!empty($char)) $targetpage = "results.php?letter=$char&";
else $targetpage = "az.php?"; //your file name (the name of this file)
$page = $_GET['page'];
if($page)
$start = ($page - 1) * $limit; //first item to display on this page
else
$start = 0; //if no page var is given, set start to 0
/* Get data. */
if($char=="*") $sql = "SELECT * FROM $tbl_name LIMIT $start, $limit";
elseif($char=="num") $sql = "SELECT * FROM $tbl_name WHERE title REGEXP '^[0-9]' LIMIT $start, $limit";
else $sql = "SELECT * FROM $tbl_name WHERE title LIKE '$char%' LIMIT $start, $limit";
$result = mysql_query($sql);
/* Setup page vars for display. */
if ($page == 0) $page = 1; //if no page var is given, default to 1.
$prev = $page - 1; //previous page is page - 1
$next = $page + 1; //next page is page + 1
$lastpage = ceil($total_pages/$limit); //lastpage is = total pages / items per page, rounded up.
$lpm1 = $lastpage - 1; //last page minus 1
/*
Now we apply our rules and draw the pagination object.
We're actually saving the code to a variable in case we want to draw it more than once.
*/
$pagination = "";
if($lastpage > 1)
{
$pagination .= "<div class=\"pagination\">";
//previous button
if ($page > 1)
$pagination.= "<a href=\"$targetpage"."page=$prev\">« previous </a>";
else
$pagination.= "<span class=\"disabled\">« previous </span>";
//pages
if ($lastpage < 7 + ($adjacents * 2)) //not enough pages to bother breaking it up
{
for ($counter = 1; $counter <= $lastpage; $counter++)
{
if ($counter == $page)
$pagination.= "<span class=\"current\">$counter</span>";
else
$pagination.= "<a href=\"$targetpage"."page=$counter\">$counter</a>";
}
}
elseif($lastpage > 5 + ($adjacents * 2)) //enough pages to hide some
{
//close to beginning; only hide later pages
if($page < 1 + ($adjacents * 2))
{
for ($counter = 1; $counter < 4 + ($adjacents * 2); $counter++)
{
if ($counter == $page)
$pagination.= "<span class=\"current\">$counter</span>";
else
$pagination.= "<a href=\"$targetpage"."page=$counter\">$counter</a>";
}
$pagination.= "...";
$pagination.= "<a href=\"$targetpage"."page=$lpm1\">$lpm1</a>";
$pagination.= "<a href=\"$targetpage"."page=$lastpage\">$lastpage</a>";
}
//in middle; hide some front and some back
elseif($lastpage - ($adjacents * 2) > $page && $page > ($adjacents * 2))
{
$pagination.= "<a href=\"$targetpage"."page=1\">1</a>";
$pagination.= "<a href=\"$targetpage"."page=2\">2</a>";
$pagination.= "...";
for ($counter = $page - $adjacents; $counter <= $page + $adjacents; $counter++)
{
if ($counter == $page)
$pagination.= "<span class=\"current\">$counter</span>";
else
$pagination.= "<a href=\"$targetpage"."page=$counter\">$counter</a>";
}
$pagination.= "...";
$pagination.= "<a href=\"$targetpage"."page=$lpm1\">$lpm1</a>";
$pagination.= "<a href=\"$targetpage"."page=$lastpage\">$lastpage</a>";
}
//close to end; only hide early pages
else
{
$pagination.= "<a href=\"$targetpage"."page=1\">1</a>";
$pagination.= "<a href=\"$targetpage"."page=2\">2</a>";
$pagination.= "...";
for ($counter = $lastpage - (2 + ($adjacents * 2)); $counter <= $lastpage; $counter++)
{
if ($counter == $page)
$pagination.= "<span class=\"current\">$counter</span>";
else
$pagination.= "<a href=\"$targetpage"."page=$counter\">$counter</a>";
}
}
}
//next button
if ($page < $counter - 1)
$pagination.= "<a href=\"$targetpage"."page=$next\"> next »</a>";
else
$pagination.= "<span class=\"disabled\"> next »</span>";
$pagination.= "</div>\n";
}
echo '<div id="ad-wrapper">';
if($total_pages==0) echo "No Results for ".$char."!";
else{
$c = -1;
while($row = mysql_fetch_array($result))
{
if($c%$rows==$rows-1) echo "<br/>";
echo "<a href=\"details.php?id=$row[n] \"><img class=\"ads\" alt=\"$row[alt]\" title=\"$row[alt]\" src=\"$row[banner]\"><p /> $row[alt]";
$c++;
$c++;
}
}
}
echo $pagination;
?>
- <?php
- // How many adjacent pages should be shown on each side?
- $adjacents = 1; //This only applies to lists that are more then 8 pages (controls the ...'s not the list)
- //how many items to show per page
- $limit = 10;
- //Number of ads per row
- $rows = 3;
- //This creates the menu at the top A-Z
- $char = $_GET['letter'];
- $list="num";
- if(!empty($char)){
- include('connect.php');
- $tbl_name="amp_ads"; //your table name
- /*
- First get total number of rows in data table.
- If you have a WHERE clause in your query, make sure you mirror it here.
- */
- if((empty($char))||($char=="*")) $query = "SELECT COUNT(*) as num FROM $tbl_name";
- elseif($char=="num") $query = "SELECT COUNT(*) as num FROM $tbl_name WHERE title REGEXP '^[0-9]'";
- else $query = "SELECT COUNT(*) as num FROM $tbl_name WHERE title LIKE '$char%'";
- $total_pages = mysql_fetch_array(mysql_query($query));
- $total_pages = $total_pages[num];
- /* Setup vars for query. */
- if(!empty($char)) $targetpage = "results.php?letter=$char&";
- else $targetpage = "az.php?"; //your file name (the name of this file)
- $page = $_GET['page'];
- if($page)
- $start = ($page - 1) * $limit; //first item to display on this page
- else
- $start = 0; //if no page var is given, set start to 0
- /* Get data. */
- if($char=="*") $sql = "SELECT * FROM $tbl_name LIMIT $start, $limit";
- elseif($char=="num") $sql = "SELECT * FROM $tbl_name WHERE title REGEXP '^[0-9]' LIMIT $start, $limit";
- else $sql = "SELECT * FROM $tbl_name WHERE title LIKE '$char%' LIMIT $start, $limit";
- $result = mysql_query($sql);
- /* Setup page vars for display. */
- if ($page == 0) $page = 1; //if no page var is given, default to 1.
- $prev = $page - 1; //previous page is page - 1
- $next = $page + 1; //next page is page + 1
- $lastpage = ceil($total_pages/$limit); //lastpage is = total pages / items per page, rounded up.
- $lpm1 = $lastpage - 1; //last page minus 1
- /*
- Now we apply our rules and draw the pagination object.
- We're actually saving the code to a variable in case we want to draw it more than once.
- */
- $pagination = "";
- if($lastpage > 1)
- {
- $pagination .= "<div class=\"pagination\">";
- //previous button
- if ($page > 1)
- $pagination.= "<a href=\"$targetpage"."page=$prev\">« previous </a>";
- else
- $pagination.= "<span class=\"disabled\">« previous </span>";
- //pages
- if ($lastpage < 7 + ($adjacents * 2)) //not enough pages to bother breaking it up
- {
- for ($counter = 1; $counter <= $lastpage; $counter++)
- {
- if ($counter == $page)
- $pagination.= "<span class=\"current\">$counter</span>";
- else
- $pagination.= "<a href=\"$targetpage"."page=$counter\">$counter</a>";
- }
- }
- elseif($lastpage > 5 + ($adjacents * 2)) //enough pages to hide some
- {
- //close to beginning; only hide later pages
- if($page < 1 + ($adjacents * 2))
- {
- for ($counter = 1; $counter < 4 + ($adjacents * 2); $counter++)
- {
- if ($counter == $page)
- $pagination.= "<span class=\"current\">$counter</span>";
- else
- $pagination.= "<a href=\"$targetpage"."page=$counter\">$counter</a>";
- }
- $pagination.= "...";
- $pagination.= "<a href=\"$targetpage"."page=$lpm1\">$lpm1</a>";
- $pagination.= "<a href=\"$targetpage"."page=$lastpage\">$lastpage</a>";
- }
- //in middle; hide some front and some back
- elseif($lastpage - ($adjacents * 2) > $page && $page > ($adjacents * 2))
- {
- $pagination.= "<a href=\"$targetpage"."page=1\">1</a>";
- $pagination.= "<a href=\"$targetpage"."page=2\">2</a>";
- $pagination.= "...";
- for ($counter = $page - $adjacents; $counter <= $page + $adjacents; $counter++)
- {
- if ($counter == $page)
- $pagination.= "<span class=\"current\">$counter</span>";
- else
- $pagination.= "<a href=\"$targetpage"."page=$counter\">$counter</a>";
- }
- $pagination.= "...";
- $pagination.= "<a href=\"$targetpage"."page=$lpm1\">$lpm1</a>";
- $pagination.= "<a href=\"$targetpage"."page=$lastpage\">$lastpage</a>";
- }
- //close to end; only hide early pages
- else
- {
- $pagination.= "<a href=\"$targetpage"."page=1\">1</a>";
- $pagination.= "<a href=\"$targetpage"."page=2\">2</a>";
- $pagination.= "...";
- for ($counter = $lastpage - (2 + ($adjacents * 2)); $counter <= $lastpage; $counter++)
- {
- if ($counter == $page)
- $pagination.= "<span class=\"current\">$counter</span>";
- else
- $pagination.= "<a href=\"$targetpage"."page=$counter\">$counter</a>";
- }
- }
- }
- //next button
- if ($page < $counter - 1)
- $pagination.= "<a href=\"$targetpage"."page=$next\"> next »</a>";
- else
- $pagination.= "<span class=\"disabled\"> next »</span>";
- $pagination.= "</div>\n";
- }
- echo '<div id="ad-wrapper">';
- if($total_pages==0) echo "No Results for ".$char."!";
- else{
- $c = -1;
- while($row = mysql_fetch_array($result))
- {
- if($c%$rows==$rows-1) echo "<br/>";
- echo "<a href=\"details.php?id=$row[n] \"><img class=\"ads\" alt=\"$row[alt]\" title=\"$row[alt]\" src=\"$row[banner]\"><p /> $row[alt]";
- $c++;
- $c++;
- }
- }
- }
- echo $pagination;
- ?>
et il suffit d'inclure dans la balise div
Code: [ Select ]
<div id="target">
<?php
include 'results.php';
?>
</div>
<?php
include 'results.php';
?>
</div>
- <div id="target">
- <?php
- include 'results.php';
- ?>
- </div>
Si Im ne me trompé les résultats page retourne nothing si les variables ne sont pas le programme d'installation.
- Brian Jester
- Beginner


- Inscription: Jan 06, 2006
- Messages: 61
- Loc: Bayonne, New Jersey USA
- Status: Offline
- ScottG
- Proficient


- Inscription: Juil 06, 2010
- Messages: 260
- Status: Offline
Désolé, j'ai envoyé que sur non testé, j'ai oublié d'ajouter quelques petites choses
J'ai raté quelque chose dans le results.php
AZ.php
index.php
EDIT:: j'ai tapé plus lentement que je pensais tout à l'heure donc j'ai corrigé ce que je disais au sommet ainsi que les balises de code que j'ai foiré. Il s'agit d'un exemple de travail moins les trucs de Mysql. Ceci rechargera le tape pas page cependant pouvoir charger le contenu dans la cible div.
J'ai raté quelque chose dans le results.php
Code: [ Select ]
<?php
// How many adjacent pages should be shown on each side?
$adjacents = 1; //This only applies to lists that are more then 8 pages (controls the ...'s not the list)
//how many items to show per page
$limit = 10;
//Number of ads per row
$rows = 3;
//This creates the menu at the top A-Z
$char = $_GET['letter'];
$list="num";
if(!empty($char)){
include('connect.php');
$tbl_name="amp_ads"; //your table name
/*
First get total number of rows in data table.
If you have a WHERE clause in your query, make sure you mirror it here.
*/
if((empty($char))||($char=="*")) $query = "SELECT COUNT(*) as num FROM $tbl_name";
elseif($char=="num") $query = "SELECT COUNT(*) as num FROM $tbl_name WHERE title REGEXP '^[0-9]'";
else $query = "SELECT COUNT(*) as num FROM $tbl_name WHERE title LIKE '$char%'";
$total_pages = mysql_fetch_array(mysql_query($query));
$total_pages = $total_pages[num];
/* Setup vars for query. */
if(!empty($char)) $targetpage = $_SERVER['PHP_SELF'] . "?letter=$char&";
else $targetpage = "az.php?"; //your file name (the name of this file)
$page = $_GET['page'];
if($page)
$start = ($page - 1) * $limit; //first item to display on this page
else
$start = 0; //if no page var is given, set start to 0
/* Get data. */
if($char=="*") $sql = "SELECT * FROM $tbl_name LIMIT $start, $limit";
elseif($char=="num") $sql = "SELECT * FROM $tbl_name WHERE title REGEXP '^[0-9]' LIMIT $start, $limit";
else $sql = "SELECT * FROM $tbl_name WHERE title LIKE '$char%' LIMIT $start, $limit";
$result = mysql_query($sql);
/* Setup page vars for display. */
if ($page == 0) $page = 1; //if no page var is given, default to 1.
$prev = $page - 1; //previous page is page - 1
$next = $page + 1; //next page is page + 1
$lastpage = ceil($total_pages/$limit); //lastpage is = total pages / items per page, rounded up.
$lpm1 = $lastpage - 1; //last page minus 1
/*
Now we apply our rules and draw the pagination object.
We're actually saving the code to a variable in case we want to draw it more than once.
*/
$pagination = "";
if($lastpage > 1)
{
$pagination .= "<div class=\"pagination\">";
//previous button
if ($page > 1)
$pagination.= "<a href=\"$targetpage"."page=$prev\">« previous </a>";
else
$pagination.= "<span class=\"disabled\">« previous </span>";
//pages
if ($lastpage < 7 + ($adjacents * 2)) //not enough pages to bother breaking it up
{
for ($counter = 1; $counter <= $lastpage; $counter++)
{
if ($counter == $page)
$pagination.= "<span class=\"current\">$counter</span>";
else
$pagination.= "<a href=\"$targetpage"."page=$counter\">$counter</a>";
}
}
elseif($lastpage > 5 + ($adjacents * 2)) //enough pages to hide some
{
//close to beginning; only hide later pages
if($page < 1 + ($adjacents * 2))
{
for ($counter = 1; $counter < 4 + ($adjacents * 2); $counter++)
{
if ($counter == $page)
$pagination.= "<span class=\"current\">$counter</span>";
else
$pagination.= "<a href=\"$targetpage"."page=$counter\">$counter</a>";
}
$pagination.= "...";
$pagination.= "<a href=\"$targetpage"."page=$lpm1\">$lpm1</a>";
$pagination.= "<a href=\"$targetpage"."page=$lastpage\">$lastpage</a>";
}
//in middle; hide some front and some back
elseif($lastpage - ($adjacents * 2) > $page && $page > ($adjacents * 2))
{
$pagination.= "<a href=\"$targetpage"."page=1\">1</a>";
$pagination.= "<a href=\"$targetpage"."page=2\">2</a>";
$pagination.= "...";
for ($counter = $page - $adjacents; $counter <= $page + $adjacents; $counter++)
{
if ($counter == $page)
$pagination.= "<span class=\"current\">$counter</span>";
else
$pagination.= "<a href=\"$targetpage"."page=$counter\">$counter</a>";
}
$pagination.= "...";
$pagination.= "<a href=\"$targetpage"."page=$lpm1\">$lpm1</a>";
$pagination.= "<a href=\"$targetpage"."page=$lastpage\">$lastpage</a>";
}
//close to end; only hide early pages
else
{
$pagination.= "<a href=\"$targetpage"."page=1\">1</a>";
$pagination.= "<a href=\"$targetpage"."page=2\">2</a>";
$pagination.= "...";
for ($counter = $lastpage - (2 + ($adjacents * 2)); $counter <= $lastpage; $counter++)
{
if ($counter == $page)
$pagination.= "<span class=\"current\">$counter</span>";
else
$pagination.= "<a href=\"$targetpage"."page=$counter\">$counter</a>";
}
}
}
//next button
if ($page < $counter - 1)
$pagination.= "<a href=\"$targetpage"."page=$next\"> next »</a>";
else
$pagination.= "<span class=\"disabled\"> next »</span>";
$pagination.= "</div>\n";
}
echo '<div id="ad-wrapper">';
if($total_pages==0) echo "No Results for ".$char."!";
else{
$c = -1;
while($row = mysql_fetch_array($result))
{
if($c%$rows==$rows-1) echo "<br/>";
echo "<a href=\"details.php?id=$row[n] \"><img class=\"ads\" alt=\"$row[alt]\" title=\"$row[alt]\" src=\"$row[banner]\"><p /> $row[alt]";
$c++;
$c++;
}
}
}
echo $pagination;
?>
// How many adjacent pages should be shown on each side?
$adjacents = 1; //This only applies to lists that are more then 8 pages (controls the ...'s not the list)
//how many items to show per page
$limit = 10;
//Number of ads per row
$rows = 3;
//This creates the menu at the top A-Z
$char = $_GET['letter'];
$list="num";
if(!empty($char)){
include('connect.php');
$tbl_name="amp_ads"; //your table name
/*
First get total number of rows in data table.
If you have a WHERE clause in your query, make sure you mirror it here.
*/
if((empty($char))||($char=="*")) $query = "SELECT COUNT(*) as num FROM $tbl_name";
elseif($char=="num") $query = "SELECT COUNT(*) as num FROM $tbl_name WHERE title REGEXP '^[0-9]'";
else $query = "SELECT COUNT(*) as num FROM $tbl_name WHERE title LIKE '$char%'";
$total_pages = mysql_fetch_array(mysql_query($query));
$total_pages = $total_pages[num];
/* Setup vars for query. */
if(!empty($char)) $targetpage = $_SERVER['PHP_SELF'] . "?letter=$char&";
else $targetpage = "az.php?"; //your file name (the name of this file)
$page = $_GET['page'];
if($page)
$start = ($page - 1) * $limit; //first item to display on this page
else
$start = 0; //if no page var is given, set start to 0
/* Get data. */
if($char=="*") $sql = "SELECT * FROM $tbl_name LIMIT $start, $limit";
elseif($char=="num") $sql = "SELECT * FROM $tbl_name WHERE title REGEXP '^[0-9]' LIMIT $start, $limit";
else $sql = "SELECT * FROM $tbl_name WHERE title LIKE '$char%' LIMIT $start, $limit";
$result = mysql_query($sql);
/* Setup page vars for display. */
if ($page == 0) $page = 1; //if no page var is given, default to 1.
$prev = $page - 1; //previous page is page - 1
$next = $page + 1; //next page is page + 1
$lastpage = ceil($total_pages/$limit); //lastpage is = total pages / items per page, rounded up.
$lpm1 = $lastpage - 1; //last page minus 1
/*
Now we apply our rules and draw the pagination object.
We're actually saving the code to a variable in case we want to draw it more than once.
*/
$pagination = "";
if($lastpage > 1)
{
$pagination .= "<div class=\"pagination\">";
//previous button
if ($page > 1)
$pagination.= "<a href=\"$targetpage"."page=$prev\">« previous </a>";
else
$pagination.= "<span class=\"disabled\">« previous </span>";
//pages
if ($lastpage < 7 + ($adjacents * 2)) //not enough pages to bother breaking it up
{
for ($counter = 1; $counter <= $lastpage; $counter++)
{
if ($counter == $page)
$pagination.= "<span class=\"current\">$counter</span>";
else
$pagination.= "<a href=\"$targetpage"."page=$counter\">$counter</a>";
}
}
elseif($lastpage > 5 + ($adjacents * 2)) //enough pages to hide some
{
//close to beginning; only hide later pages
if($page < 1 + ($adjacents * 2))
{
for ($counter = 1; $counter < 4 + ($adjacents * 2); $counter++)
{
if ($counter == $page)
$pagination.= "<span class=\"current\">$counter</span>";
else
$pagination.= "<a href=\"$targetpage"."page=$counter\">$counter</a>";
}
$pagination.= "...";
$pagination.= "<a href=\"$targetpage"."page=$lpm1\">$lpm1</a>";
$pagination.= "<a href=\"$targetpage"."page=$lastpage\">$lastpage</a>";
}
//in middle; hide some front and some back
elseif($lastpage - ($adjacents * 2) > $page && $page > ($adjacents * 2))
{
$pagination.= "<a href=\"$targetpage"."page=1\">1</a>";
$pagination.= "<a href=\"$targetpage"."page=2\">2</a>";
$pagination.= "...";
for ($counter = $page - $adjacents; $counter <= $page + $adjacents; $counter++)
{
if ($counter == $page)
$pagination.= "<span class=\"current\">$counter</span>";
else
$pagination.= "<a href=\"$targetpage"."page=$counter\">$counter</a>";
}
$pagination.= "...";
$pagination.= "<a href=\"$targetpage"."page=$lpm1\">$lpm1</a>";
$pagination.= "<a href=\"$targetpage"."page=$lastpage\">$lastpage</a>";
}
//close to end; only hide early pages
else
{
$pagination.= "<a href=\"$targetpage"."page=1\">1</a>";
$pagination.= "<a href=\"$targetpage"."page=2\">2</a>";
$pagination.= "...";
for ($counter = $lastpage - (2 + ($adjacents * 2)); $counter <= $lastpage; $counter++)
{
if ($counter == $page)
$pagination.= "<span class=\"current\">$counter</span>";
else
$pagination.= "<a href=\"$targetpage"."page=$counter\">$counter</a>";
}
}
}
//next button
if ($page < $counter - 1)
$pagination.= "<a href=\"$targetpage"."page=$next\"> next »</a>";
else
$pagination.= "<span class=\"disabled\"> next »</span>";
$pagination.= "</div>\n";
}
echo '<div id="ad-wrapper">';
if($total_pages==0) echo "No Results for ".$char."!";
else{
$c = -1;
while($row = mysql_fetch_array($result))
{
if($c%$rows==$rows-1) echo "<br/>";
echo "<a href=\"details.php?id=$row[n] \"><img class=\"ads\" alt=\"$row[alt]\" title=\"$row[alt]\" src=\"$row[banner]\"><p /> $row[alt]";
$c++;
$c++;
}
}
}
echo $pagination;
?>
- <?php
- // How many adjacent pages should be shown on each side?
- $adjacents = 1; //This only applies to lists that are more then 8 pages (controls the ...'s not the list)
- //how many items to show per page
- $limit = 10;
- //Number of ads per row
- $rows = 3;
- //This creates the menu at the top A-Z
- $char = $_GET['letter'];
- $list="num";
- if(!empty($char)){
- include('connect.php');
- $tbl_name="amp_ads"; //your table name
- /*
- First get total number of rows in data table.
- If you have a WHERE clause in your query, make sure you mirror it here.
- */
- if((empty($char))||($char=="*")) $query = "SELECT COUNT(*) as num FROM $tbl_name";
- elseif($char=="num") $query = "SELECT COUNT(*) as num FROM $tbl_name WHERE title REGEXP '^[0-9]'";
- else $query = "SELECT COUNT(*) as num FROM $tbl_name WHERE title LIKE '$char%'";
- $total_pages = mysql_fetch_array(mysql_query($query));
- $total_pages = $total_pages[num];
- /* Setup vars for query. */
- if(!empty($char)) $targetpage = $_SERVER['PHP_SELF'] . "?letter=$char&";
- else $targetpage = "az.php?"; //your file name (the name of this file)
- $page = $_GET['page'];
- if($page)
- $start = ($page - 1) * $limit; //first item to display on this page
- else
- $start = 0; //if no page var is given, set start to 0
- /* Get data. */
- if($char=="*") $sql = "SELECT * FROM $tbl_name LIMIT $start, $limit";
- elseif($char=="num") $sql = "SELECT * FROM $tbl_name WHERE title REGEXP '^[0-9]' LIMIT $start, $limit";
- else $sql = "SELECT * FROM $tbl_name WHERE title LIKE '$char%' LIMIT $start, $limit";
- $result = mysql_query($sql);
- /* Setup page vars for display. */
- if ($page == 0) $page = 1; //if no page var is given, default to 1.
- $prev = $page - 1; //previous page is page - 1
- $next = $page + 1; //next page is page + 1
- $lastpage = ceil($total_pages/$limit); //lastpage is = total pages / items per page, rounded up.
- $lpm1 = $lastpage - 1; //last page minus 1
- /*
- Now we apply our rules and draw the pagination object.
- We're actually saving the code to a variable in case we want to draw it more than once.
- */
- $pagination = "";
- if($lastpage > 1)
- {
- $pagination .= "<div class=\"pagination\">";
- //previous button
- if ($page > 1)
- $pagination.= "<a href=\"$targetpage"."page=$prev\">« previous </a>";
- else
- $pagination.= "<span class=\"disabled\">« previous </span>";
- //pages
- if ($lastpage < 7 + ($adjacents * 2)) //not enough pages to bother breaking it up
- {
- for ($counter = 1; $counter <= $lastpage; $counter++)
- {
- if ($counter == $page)
- $pagination.= "<span class=\"current\">$counter</span>";
- else
- $pagination.= "<a href=\"$targetpage"."page=$counter\">$counter</a>";
- }
- }
- elseif($lastpage > 5 + ($adjacents * 2)) //enough pages to hide some
- {
- //close to beginning; only hide later pages
- if($page < 1 + ($adjacents * 2))
- {
- for ($counter = 1; $counter < 4 + ($adjacents * 2); $counter++)
- {
- if ($counter == $page)
- $pagination.= "<span class=\"current\">$counter</span>";
- else
- $pagination.= "<a href=\"$targetpage"."page=$counter\">$counter</a>";
- }
- $pagination.= "...";
- $pagination.= "<a href=\"$targetpage"."page=$lpm1\">$lpm1</a>";
- $pagination.= "<a href=\"$targetpage"."page=$lastpage\">$lastpage</a>";
- }
- //in middle; hide some front and some back
- elseif($lastpage - ($adjacents * 2) > $page && $page > ($adjacents * 2))
- {
- $pagination.= "<a href=\"$targetpage"."page=1\">1</a>";
- $pagination.= "<a href=\"$targetpage"."page=2\">2</a>";
- $pagination.= "...";
- for ($counter = $page - $adjacents; $counter <= $page + $adjacents; $counter++)
- {
- if ($counter == $page)
- $pagination.= "<span class=\"current\">$counter</span>";
- else
- $pagination.= "<a href=\"$targetpage"."page=$counter\">$counter</a>";
- }
- $pagination.= "...";
- $pagination.= "<a href=\"$targetpage"."page=$lpm1\">$lpm1</a>";
- $pagination.= "<a href=\"$targetpage"."page=$lastpage\">$lastpage</a>";
- }
- //close to end; only hide early pages
- else
- {
- $pagination.= "<a href=\"$targetpage"."page=1\">1</a>";
- $pagination.= "<a href=\"$targetpage"."page=2\">2</a>";
- $pagination.= "...";
- for ($counter = $lastpage - (2 + ($adjacents * 2)); $counter <= $lastpage; $counter++)
- {
- if ($counter == $page)
- $pagination.= "<span class=\"current\">$counter</span>";
- else
- $pagination.= "<a href=\"$targetpage"."page=$counter\">$counter</a>";
- }
- }
- }
- //next button
- if ($page < $counter - 1)
- $pagination.= "<a href=\"$targetpage"."page=$next\"> next »</a>";
- else
- $pagination.= "<span class=\"disabled\"> next »</span>";
- $pagination.= "</div>\n";
- }
- echo '<div id="ad-wrapper">';
- if($total_pages==0) echo "No Results for ".$char."!";
- else{
- $c = -1;
- while($row = mysql_fetch_array($result))
- {
- if($c%$rows==$rows-1) echo "<br/>";
- echo "<a href=\"details.php?id=$row[n] \"><img class=\"ads\" alt=\"$row[alt]\" title=\"$row[alt]\" src=\"$row[banner]\"><p /> $row[alt]";
- $c++;
- $c++;
- }
- }
- }
- echo $pagination;
- ?>
AZ.php
Code: [ Select ]
<div id="aznavbar" class="drop-shadow raised">
<?php
//This creates the menu at the top A-Z
$char = $_GET['letter'];
$list="num";
foreach (range('A', 'Z') as $i) $list.=",$i";
$list.=",Show All Ads";
$a = explode(',', $list);
foreach ($a as $b) {
if (!empty($b)) {
if ($b=="num") {
if ($char=="num") echo "<a href=\"" .$_SERVER['PHP_SELF'] . "?letter=num\">#</a>";
else echo "<a href=\"" .$_SERVER['PHP_SELF'] . "?letter=num\">#</a>";
}
elseif ($b=="Show All Ads") {
if (($char=="*")||(empty($char))) echo "<a href=\"" .$_SERVER['PHP_SELF'] . "?letter=*\">Show All Ads</a>";
else echo "<a href=\"" .$_SERVER['PHP_SELF'] . "?letter=*\">Show All Ads</a>";
}
elseif($b==$char) echo "<a href=\"" .$_SERVER['PHP_SELF'] . "?letter=".$b."\">$b</a>";
else echo "<a href=\"" .$_SERVER['PHP_SELF'] . "?letter=".$b."\">$b</a>";
}
}
?>
</div>
<?php
//This creates the menu at the top A-Z
$char = $_GET['letter'];
$list="num";
foreach (range('A', 'Z') as $i) $list.=",$i";
$list.=",Show All Ads";
$a = explode(',', $list);
foreach ($a as $b) {
if (!empty($b)) {
if ($b=="num") {
if ($char=="num") echo "<a href=\"" .$_SERVER['PHP_SELF'] . "?letter=num\">#</a>";
else echo "<a href=\"" .$_SERVER['PHP_SELF'] . "?letter=num\">#</a>";
}
elseif ($b=="Show All Ads") {
if (($char=="*")||(empty($char))) echo "<a href=\"" .$_SERVER['PHP_SELF'] . "?letter=*\">Show All Ads</a>";
else echo "<a href=\"" .$_SERVER['PHP_SELF'] . "?letter=*\">Show All Ads</a>";
}
elseif($b==$char) echo "<a href=\"" .$_SERVER['PHP_SELF'] . "?letter=".$b."\">$b</a>";
else echo "<a href=\"" .$_SERVER['PHP_SELF'] . "?letter=".$b."\">$b</a>";
}
}
?>
</div>
- <div id="aznavbar" class="drop-shadow raised">
- <?php
- //This creates the menu at the top A-Z
- $char = $_GET['letter'];
- $list="num";
- foreach (range('A', 'Z') as $i) $list.=",$i";
- $list.=",Show All Ads";
- $a = explode(',', $list);
- foreach ($a as $b) {
- if (!empty($b)) {
- if ($b=="num") {
- if ($char=="num") echo "<a href=\"" .$_SERVER['PHP_SELF'] . "?letter=num\">#</a>";
- else echo "<a href=\"" .$_SERVER['PHP_SELF'] . "?letter=num\">#</a>";
- }
- elseif ($b=="Show All Ads") {
- if (($char=="*")||(empty($char))) echo "<a href=\"" .$_SERVER['PHP_SELF'] . "?letter=*\">Show All Ads</a>";
- else echo "<a href=\"" .$_SERVER['PHP_SELF'] . "?letter=*\">Show All Ads</a>";
- }
- elseif($b==$char) echo "<a href=\"" .$_SERVER['PHP_SELF'] . "?letter=".$b."\">$b</a>";
- else echo "<a href=\"" .$_SERVER['PHP_SELF'] . "?letter=".$b."\">$b</a>";
- }
- }
- ?>
- </div>
index.php
Code: [ Select ]
<html>
<head> <title> </title>
<meta name="viewport" content="initial-scale=1.0">
<link rel="stylesheet" type="text/css" href="css/breadcrumb.css" media="screen" charset="utf-8" />
<link rel="stylesheet" type="text/css" href="css/default.css" media="screen" charset="utf-8" />
<link rel="stylesheet" type="text/css" href="css/menu.css" media="screen" charset="utf-8" />
<style media="screen" type="text/css">
html, body { }
#aznavbar a:link {
color: #0C7FB0;
font-family:Verdana,Geneva,'DejaVu Sans',sans-serif;
margin-left: 4.15px;
padding: 10px;
text-decoration:none;
}
#aznavbar a:visited {
color: #0C7FB0;
font-family:Verdana,Geneva,'DejaVu Sans',sans-serif;
padding: 10px;
text-decoration:none;
}
#aznavbar a:hover {
background-color: #FA6405;
color:#000;
font-family:Verdana,Geneva,'DejaVu Sans',sans-serif;
padding: 10px;
text-decoration:none;
}
#aznavbar a:active{
color:#FA6405;
font-family:Verdana,Geneva,'DejaVu Sans',sans-serif;
padding: 10px;
text-decoration:none;
}
#aznavbar {
background: #141414;
background: -moz-linear-gradient(top, #32323a 0%, #141414 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #32323a), color-stop(100%, #141414));
background: -webkit-linear-gradient(top, #32323a 0%, #141414 100%);
background: -o-linear-gradient(top, #32323a 0%, #141414 100%);
background: -ms-linear-gradient(top, #32323a 0%, #141414 100%);
background: linear-gradient(to bottom, #32323a 0%, #141414 100%);
filter: progid:DXImageTransform.Microsoft.Gradient(StartColorStr='#32323a', EndColorStr='#141414', GradientType=0);
border: 1px solid #000;
margin: -10px 0px 0px -8px;
padding: 10 0px 10px 80px;
width: 94.8%;
}
a:hover#showall {
}
#ad-wrapper{
margin:0px auto 0px auto;
text-align:center;
}
</style>
</head>
<body>
<?php include('az.php'); ?>
<div class="drop-shadow lifted" id="header"><img src="/test2/images/logo.png" alt="Reunite My Site - Company Logo" title="Reunite My Site - Company Logo"> </div>
<div id="login">Login: <input type="username" class="login" size="20px;">
<br />
Password: <input class="login" type="password" size="20px">
<br />
Remember Me? <input type="checkbox">
<a href="#">Register Now For Free!</a>
<div class="note orange rounded">Start your Advertising or Publishing Campaign Now by simply clicking the Register Now button above!</div></div>
<div name="target" id="target"><?php include 'results.php'; ?></div>
</body>
</html>
<head> <title> </title>
<meta name="viewport" content="initial-scale=1.0">
<link rel="stylesheet" type="text/css" href="css/breadcrumb.css" media="screen" charset="utf-8" />
<link rel="stylesheet" type="text/css" href="css/default.css" media="screen" charset="utf-8" />
<link rel="stylesheet" type="text/css" href="css/menu.css" media="screen" charset="utf-8" />
<style media="screen" type="text/css">
html, body { }
#aznavbar a:link {
color: #0C7FB0;
font-family:Verdana,Geneva,'DejaVu Sans',sans-serif;
margin-left: 4.15px;
padding: 10px;
text-decoration:none;
}
#aznavbar a:visited {
color: #0C7FB0;
font-family:Verdana,Geneva,'DejaVu Sans',sans-serif;
padding: 10px;
text-decoration:none;
}
#aznavbar a:hover {
background-color: #FA6405;
color:#000;
font-family:Verdana,Geneva,'DejaVu Sans',sans-serif;
padding: 10px;
text-decoration:none;
}
#aznavbar a:active{
color:#FA6405;
font-family:Verdana,Geneva,'DejaVu Sans',sans-serif;
padding: 10px;
text-decoration:none;
}
#aznavbar {
background: #141414;
background: -moz-linear-gradient(top, #32323a 0%, #141414 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #32323a), color-stop(100%, #141414));
background: -webkit-linear-gradient(top, #32323a 0%, #141414 100%);
background: -o-linear-gradient(top, #32323a 0%, #141414 100%);
background: -ms-linear-gradient(top, #32323a 0%, #141414 100%);
background: linear-gradient(to bottom, #32323a 0%, #141414 100%);
filter: progid:DXImageTransform.Microsoft.Gradient(StartColorStr='#32323a', EndColorStr='#141414', GradientType=0);
border: 1px solid #000;
margin: -10px 0px 0px -8px;
padding: 10 0px 10px 80px;
width: 94.8%;
}
a:hover#showall {
}
#ad-wrapper{
margin:0px auto 0px auto;
text-align:center;
}
</style>
</head>
<body>
<?php include('az.php'); ?>
<div class="drop-shadow lifted" id="header"><img src="/test2/images/logo.png" alt="Reunite My Site - Company Logo" title="Reunite My Site - Company Logo"> </div>
<div id="login">Login: <input type="username" class="login" size="20px;">
<br />
Password: <input class="login" type="password" size="20px">
<br />
Remember Me? <input type="checkbox">
<a href="#">Register Now For Free!</a>
<div class="note orange rounded">Start your Advertising or Publishing Campaign Now by simply clicking the Register Now button above!</div></div>
<div name="target" id="target"><?php include 'results.php'; ?></div>
</body>
</html>
- <html>
- <head> <title> </title>
- <meta name="viewport" content="initial-scale=1.0">
- <link rel="stylesheet" type="text/css" href="css/breadcrumb.css" media="screen" charset="utf-8" />
- <link rel="stylesheet" type="text/css" href="css/default.css" media="screen" charset="utf-8" />
- <link rel="stylesheet" type="text/css" href="css/menu.css" media="screen" charset="utf-8" />
- <style media="screen" type="text/css">
- html, body { }
- #aznavbar a:link {
- color: #0C7FB0;
- font-family:Verdana,Geneva,'DejaVu Sans',sans-serif;
- margin-left: 4.15px;
- padding: 10px;
- text-decoration:none;
- }
- #aznavbar a:visited {
- color: #0C7FB0;
- font-family:Verdana,Geneva,'DejaVu Sans',sans-serif;
- padding: 10px;
- text-decoration:none;
- }
- #aznavbar a:hover {
- background-color: #FA6405;
- color:#000;
- font-family:Verdana,Geneva,'DejaVu Sans',sans-serif;
- padding: 10px;
- text-decoration:none;
- }
- #aznavbar a:active{
- color:#FA6405;
- font-family:Verdana,Geneva,'DejaVu Sans',sans-serif;
- padding: 10px;
- text-decoration:none;
- }
- #aznavbar {
- background: #141414;
- background: -moz-linear-gradient(top, #32323a 0%, #141414 100%);
- background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #32323a), color-stop(100%, #141414));
- background: -webkit-linear-gradient(top, #32323a 0%, #141414 100%);
- background: -o-linear-gradient(top, #32323a 0%, #141414 100%);
- background: -ms-linear-gradient(top, #32323a 0%, #141414 100%);
- background: linear-gradient(to bottom, #32323a 0%, #141414 100%);
- filter: progid:DXImageTransform.Microsoft.Gradient(StartColorStr='#32323a', EndColorStr='#141414', GradientType=0);
- border: 1px solid #000;
- margin: -10px 0px 0px -8px;
- padding: 10 0px 10px 80px;
- width: 94.8%;
- }
- a:hover#showall {
- }
- #ad-wrapper{
- margin:0px auto 0px auto;
- text-align:center;
- }
- </style>
- </head>
- <body>
- <?php include('az.php'); ?>
- <div class="drop-shadow lifted" id="header"><img src="/test2/images/logo.png" alt="Reunite My Site - Company Logo" title="Reunite My Site - Company Logo"> </div>
- <div id="login">Login: <input type="username" class="login" size="20px;">
- <br />
- Password: <input class="login" type="password" size="20px">
- <br />
- Remember Me? <input type="checkbox">
- <a href="#">Register Now For Free!</a>
- <div class="note orange rounded">Start your Advertising or Publishing Campaign Now by simply clicking the Register Now button above!</div></div>
- <div name="target" id="target"><?php include 'results.php'; ?></div>
- </body>
- </html>
EDIT:: j'ai tapé plus lentement que je pensais tout à l'heure donc j'ai corrigé ce que je disais au sommet ainsi que les balises de code que j'ai foiré. Il s'agit d'un exemple de travail moins les trucs de Mysql. Ceci rechargera le tape pas page cependant pouvoir charger le contenu dans la cible div.
- Brian Jester
- Beginner


- Inscription: Jan 06, 2006
- Messages: 61
- Loc: Bayonne, New Jersey USA
- Status: Offline
- ScottG
- Proficient


- Inscription: Juil 06, 2010
- Messages: 260
- Status: Offline
- Brian Jester
- Beginner


- Inscription: Jan 06, 2006
- Messages: 61
- Loc: Bayonne, New Jersey USA
- Status: Offline
J'espère que je ne suis pas trop tard...
J'ai besoin de générer les résultats dans plusieurs colonnes, quelque chose comme un type de variable : cols $ = 4 permettra aux 4 enregistrements à afficher sur la page, puis fractionne automatiquement à la ligne suivante. À l'heure actuelle, la sortie affiche les annonces dans une seule colonne (plusieurs lignes vers le bas de la page).
Je vous remercie à l'avance Scott !
Brian
J'ai besoin de générer les résultats dans plusieurs colonnes, quelque chose comme un type de variable : cols $ = 4 permettra aux 4 enregistrements à afficher sur la page, puis fractionne automatiquement à la ligne suivante. À l'heure actuelle, la sortie affiche les annonces dans une seule colonne (plusieurs lignes vers le bas de la page).
Je vous remercie à l'avance Scott !
Brian
- ScottG
- Proficient


- Inscription: Juil 06, 2010
- Messages: 260
- Status: Offline
OK, un couple de choses Ive trouvé.
Première le lorsque vous générez les liens (en bas de la page results.php). Dans le tout en boucle le lien Isnt est-elle interrompue avec une </a> tag également entre l'image et le texte, il est un random <p/> . Dans le test, j'ai mis ensemble, j'ai sorti la <p/> et ajouté un </a> à la fin du texte.
Cela est arrivé à faire le genre de script de travail la prochaine chose que j'ai remarqué était (également dans le temps boucle en bas) vous avez eu un c ++; suivie d'une autre c ++; qui était de jouer avec votre variable de lignes $. Souscrire à une de ces variables est que votre script fonctionne correctement.
Voir le texte cité à la référence
Voici une modification tout en boucle qui devrait fonctionner pour vous
Je vais joindre les infos de test que j'ai aussi bien. Avertissement utilisant ça ne vous aidera pas que je force les informations de la base de données fausses, de me donner des résultats, je suis lui comme un matériau de référence seulement. Cela vous donnera une idée si les changements qui en résultent sont l'effet désiré.
Première le lorsque vous générez les liens (en bas de la page results.php). Dans le tout en boucle le lien Isnt est-elle interrompue avec une </a> tag également entre l'image et le texte, il est un random <p/> . Dans le test, j'ai mis ensemble, j'ai sorti la <p/> et ajouté un </a> à la fin du texte.
Cela est arrivé à faire le genre de script de travail la prochaine chose que j'ai remarqué était (également dans le temps boucle en bas) vous avez eu un c ++; suivie d'une autre c ++; qui était de jouer avec votre variable de lignes $. Souscrire à une de ces variables est que votre script fonctionne correctement.
Voir le texte cité à la référence
Quote:
tandis que ($ row = mysql_fetch_array($result))
{
if($c%$Rows==$Rows-1) echo "<br/>" ;
echo "< un href=\"details.php?id=$row[n] \ ">< classe img = \"ads\"alt = \"$ row [alt] \"title = \"$ row [alt] \"src = \"$ row [bannière] \">< p / > $row [alt]";
$c++;
$c++;
}
{
if($c%$Rows==$Rows-1) echo "<br/>" ;
echo "< un href=\"details.php?id=$row[n] \ ">< classe img = \"ads\"alt = \"$ row [alt] \"title = \"$ row [alt] \"src = \"$ row [bannière] \">< p / > $row [alt]";
$c++;
$c++;
}
Voici une modification tout en boucle qui devrait fonctionner pour vous
PHP Code: [ Select ]
while($row = mysql_fetch_array($result))
{
if($c%$rows==$rows-1) echo "<br/>";
echo "<a href=\"details.php?id=$row[n] \"><img class=\"ads\" alt=\"$row[alt]\" title=\"$row[alt]\" src=\"$row[banner]\"> $row[alt]</a>";
$c++;
}
{
if($c%$rows==$rows-1) echo "<br/>";
echo "<a href=\"details.php?id=$row[n] \"><img class=\"ads\" alt=\"$row[alt]\" title=\"$row[alt]\" src=\"$row[banner]\"> $row[alt]</a>";
$c++;
}
- while($row = mysql_fetch_array($result))
- {
- if($c%$rows==$rows-1) echo "<br/>";
- echo "<a href=\"details.php?id=$row[n] \"><img class=\"ads\" alt=\"$row[alt]\" title=\"$row[alt]\" src=\"$row[banner]\"> $row[alt]</a>";
- $c++;
- }
Je vais joindre les infos de test que j'ai aussi bien. Avertissement utilisant ça ne vous aidera pas que je force les informations de la base de données fausses, de me donner des résultats, je suis lui comme un matériau de référence seulement. Cela vous donnera une idée si les changements qui en résultent sont l'effet désiré.
Attachments:
- Anonymous
- Bot


- Inscription: 25 Feb 2008
- Messages: ?
- Loc: Ozzuland
- Status: Online
Janvier 3rd, 2013, 8:13 am
1, 2
Pour répondre à ce sujet, vous devez vous connecter ou vous enregistrer. Il est gratuit.
Afficher de l'information
- Total des messages de ce sujet: 18 messages
- Utilisateurs parcourant ce forum: Aucun utilisateur enregistré et 225 invités
- Vous ne pouvez pas poster de nouveaux sujets
- Vous ne pouvez pas répondre aux sujets
- Vous ne pouvez pas éditer vos messages
- Vous ne pouvez pas supprimer vos messages
- Vous ne pouvez pas joindre des fichiers
