Alphanav ayuda necesaria
- Brian Jester
- Beginner


- Registrado: Ene 06, 2006
- Mensajes: 61
- Loc: Bayonne, New Jersey USA
- Status: Offline
Hola todos y feliz año nuevo!
Tengo algún código de php de trabajo que muestra un índice de navegación alfabético a-z en la parte superior de mi página web, su diseño intented es abrir en una ventana nueva, pero ahora quiero que abra en la misma página...he encontrado un iframe o "interruptor" debería funcionar bien, pero aparentemente no puedo hacerlo funcionar bien.
Aquí está lo que quiero decir, una dirección url para mostrar el tema:http://reunitemysite.com/test2/login.php
Al hacer clic en cualquiera de los enlaces en el alphanav superior, la muestra de enlace el css como el mysql query provocar el iframe de destino, todo lo que quiero mostrar en el iframe es resultado de la consulta de mySQL, no el css de barra de alphanav propio.
index.php
Nota: Las dos páginas php anteriores funcionan bien excepto por el hecho de que los enlaces en el primer bloque de código, que es la naviation del alfabeto de php incluido (incluye az.php) el segundo bloque de código es donde el bloque de código debe ser modificado--justo bajo la etiqueta de cuerpo en el segundo bloque de código, pero estoy desorientado sobre lo que necesita ser cambiado.
Llevo esperando tanto tiempo para una solución a esto, no me gusta decir cuánto tiempo...
Gracias de antemano!
Brian
Tengo algún código de php de trabajo que muestra un índice de navegación alfabético a-z en la parte superior de mi página web, su diseño intented es abrir en una ventana nueva, pero ahora quiero que abra en la misma página...he encontrado un iframe o "interruptor" debería funcionar bien, pero aparentemente no puedo hacerlo funcionar bien.
Aquí está lo que quiero decir, una dirección url para mostrar el tema:http://reunitemysite.com/test2/login.php
Al hacer clic en cualquiera de los enlaces en el alphanav superior, la muestra de enlace el css como el mysql query provocar el iframe de destino, todo lo que quiero mostrar en el iframe es resultado de la consulta de mySQL, no el css de barra de alphanav propio.
index.php
Código: [ 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>
Código: [ 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>
Nota: Las dos páginas php anteriores funcionan bien excepto por el hecho de que los enlaces en el primer bloque de código, que es la naviation del alfabeto de php incluido (incluye az.php) el segundo bloque de código es donde el bloque de código debe ser modificado--justo bajo la etiqueta de cuerpo en el segundo bloque de código, pero estoy desorientado sobre lo que necesita ser cambiado.
Llevo esperando tanto tiempo para una solución a esto, no me gusta decir cuánto tiempo...
Gracias de antemano!
Brian
- Anonymous
- Bot


- Registrado: 25 Feb 2008
- Mensajes: ?
- Loc: Ozzuland
- Status: Online
Diciembre 31st, 2012, 6:27 pm
- ScottG
- Proficient


- Registrado: Jul 06, 2010
- Mensajes: 266
- Status: Online
¿necesita deshacerse de la "apertura de una nueva página" todos juntos? Si es así en el código que crea los vínculos quitar al parámetro de destino. A continuación está el código proporcionado sin el parámetro target. No probado
index.php
y suponiendo que Im az.php
index.php
PHP Código: [ 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>
y suponiendo que Im az.php
PHP Código: [ 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


- Registrado: Ene 06, 2006
- Mensajes: 61
- Loc: Bayonne, New Jersey USA
- Status: Offline
Código sigue lo mismo...he puesto el destino = "marco" en la página de az.php en los enlaces situados en esta área:
y cuando hago clic en los vínculos de la barra de az, todavía estoy recibiendo la parte de css ( #, a-z, mostrar todos los enlaces) en el iframe, no quiero que, sólo el MySQL resultados parte...
I * pensar * (a menos que me más pensando en todo esto) la parte que crea el menú de az (enlaces) en la página de az.php debe ser eliminado y que necesitaría crear una nueva barra (básicamente en html y css, no php) en la página index.php, pero el resto del código en la az.php tendría que ser actualizado para reflejar los cambios.
Espero que entienda!
Gracias de nuevo!
Brian
Quote:
//This crea el menú en la parte superior A-Z
y cuando hago clic en los vínculos de la barra de az, todavía estoy recibiendo la parte de css ( #, a-z, mostrar todos los enlaces) en el iframe, no quiero que, sólo el MySQL resultados parte...
I * pensar * (a menos que me más pensando en todo esto) la parte que crea el menú de az (enlaces) en la página de az.php debe ser eliminado y que necesitaría crear una nueva barra (básicamente en html y css, no php) en la página index.php, pero el resto del código en la az.php tendría que ser actualizado para reflejar los cambios.
Espero que entienda!
Gracias de nuevo!
Brian
- ScottG
- Proficient


- Registrado: Jul 06, 2010
- Mensajes: 266
- Status: Online
Tal vez no entiendo lo que tu tratando de lograr. Corrí el código que puse en mi post anterior y además de los errores de mysql (ya no tengo esa parte del código) abrió la az.php en la misma ventana como índice (interruptor de página total).
¿Se intenta apuntar sólo el iframe con la navegación y cargar sólo los resultados en el iframe?
¿Se intenta apuntar sólo el iframe con la navegación y cargar sólo los resultados en el iframe?
- ScottG
- Proficient


- Registrado: Jul 06, 2010
- Mensajes: 266
- Status: Online
Si ese es el caso sin embargo usando la misma página para hacer el resultado establezca y la navegación va a darle un dolor de cabeza. Les divide en dos archivos diferentes.
index.php
AZ.php
results.php
index.php
PHP Código: [ 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 Código: [ 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 Código: [ 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


- Registrado: Ene 06, 2006
- Mensajes: 61
- Loc: Bayonne, New Jersey USA
- Status: Offline
- ScottG
- Proficient


- Registrado: Jul 06, 2010
- Mensajes: 266
- Status: Online
- Brian Jester
- Beginner


- Registrado: Ene 06, 2006
- Mensajes: 61
- Loc: Bayonne, New Jersey USA
- Status: Offline
Hola Scott,
¿Odio a molestarte, y no * creo * su gran de una relación, pero en lugar de apertura en iframe, me pueden ayudar abrir en la div de php "interruptor"? Razón: La altura del iframe, creo que ustedes saben el resto...les gusta utilizar javascript para algo así.
Heres un poco de código de "cambio" que funciona:
<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>
¿Odio a molestarte, y no * creo * su gran de una relación, pero en lugar de apertura en iframe, me pueden ayudar abrir en la div de php "interruptor"? Razón: La altura del iframe, creo que ustedes saben el resto...les gusta utilizar javascript para algo así.
Heres un poco de código de "cambio" que funciona:
Código: [ 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


- Registrado: Jul 06, 2010
- Mensajes: 266
- Status: Online
Usted debe ser capaz de cambiar el results.php a esto
y apenas se incluye en la etiqueta div
Si Im no equivocado los resultados página devuelve nothing si las variables no están configurados.
PHP Código: [ 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;
- ?>
y apenas se incluye en la etiqueta div
Código: [ Select ]
<div id="target">
<?php
include 'results.php';
?>
</div>
<?php
include 'results.php';
?>
</div>
- <div id="target">
- <?php
- include 'results.php';
- ?>
- </div>
Si Im no equivocado los resultados página devuelve nothing si las variables no están configurados.
- Brian Jester
- Beginner


- Registrado: Ene 06, 2006
- Mensajes: 61
- Loc: Bayonne, New Jersey USA
- Status: Offline
- ScottG
- Proficient


- Registrado: Jul 06, 2010
- Mensajes: 266
- Status: Online
Lo siento envié que fuera me olvidé de agregar algunas cosas
Echaba de menos algo en la results.php
AZ.php
index.php
EDICIÓN:: escribí más lento de lo que estaba pensando ahora mismo por lo que me fijo lo que estaba diciendo en la parte superior, así como las etiquetas de código que meti. Este es un ejemplo de trabajo menos cosas de Mysql. Esto provocará que recargue la pare no página sin embargo cargará el contenido en el div de destino.
Echaba de menos algo en la results.php
Código: [ 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
Código: [ 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
Código: [ 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>
EDICIÓN:: escribí más lento de lo que estaba pensando ahora mismo por lo que me fijo lo que estaba diciendo en la parte superior, así como las etiquetas de código que meti. Este es un ejemplo de trabajo menos cosas de Mysql. Esto provocará que recargue la pare no página sin embargo cargará el contenido en el div de destino.
- Brian Jester
- Beginner


- Registrado: Ene 06, 2006
- Mensajes: 61
- Loc: Bayonne, New Jersey USA
- Status: Offline
- ScottG
- Proficient


- Registrado: Jul 06, 2010
- Mensajes: 266
- Status: Online
- Brian Jester
- Beginner


- Registrado: Ene 06, 2006
- Mensajes: 61
- Loc: Bayonne, New Jersey USA
- Status: Offline
Espero que no estoy demasiado tarde...
Necesito los resultados en varias columnas, algo así como un como variable de salida: $columnas = 4 permitirá 4 registros mostrar en la página y, a continuación, automáticamente se rompe a la fila siguiente. Tal y como está ahora, la salida muestra anuncios en una sola columna (varias filas hacia abajo de la página).
Gracias de antemano Scott!
Brian
Necesito los resultados en varias columnas, algo así como un como variable de salida: $columnas = 4 permitirá 4 registros mostrar en la página y, a continuación, automáticamente se rompe a la fila siguiente. Tal y como está ahora, la salida muestra anuncios en una sola columna (varias filas hacia abajo de la página).
Gracias de antemano Scott!
Brian
- ScottG
- Proficient


- Registrado: Jul 06, 2010
- Mensajes: 266
- Status: Online
OK Ive encontró un par de cosas.
Primera cuando construyes los enlaces (parte inferior de la página de results.php). Mientras el vínculo de bucle Isnt cerrada con un </a> etiqueta también entre la imagen y el texto que es un azar <p/> . Así en la prueba de que poner juntos saqué la <p/> y un </a> hasta el final del texto.
Esto sucedió para que el tipo de secuencia de comandos de trabajo la próxima cosa que noté fue (también en el tiempo lazo en la parte inferior) había un c ++; seguido de otro c ++; que fue jugar con la variable de filas $. Sacar una de estas variables hará que su script funcione correctamente.
Véase el texto citado por referencia
Aquí es una alteración al bucle que debe trabajar para usted
Voy a adjuntar la información de prueba que tengo así. ADVERTENCIA usando esto no le ayudará como fuerza a información de la base de datos falsos darme resultados les proporciono como material de referencia sólo. Esto le dará una idea si los cambios resultantes son el efecto deseado.
Primera cuando construyes los enlaces (parte inferior de la página de results.php). Mientras el vínculo de bucle Isnt cerrada con un </a> etiqueta también entre la imagen y el texto que es un azar <p/> . Así en la prueba de que poner juntos saqué la <p/> y un </a> hasta el final del texto.
Esto sucedió para que el tipo de secuencia de comandos de trabajo la próxima cosa que noté fue (también en el tiempo lazo en la parte inferior) había un c ++; seguido de otro c ++; que fue jugar con la variable de filas $. Sacar una de estas variables hará que su script funcione correctamente.
Véase el texto citado por referencia
Quote:
mientras ($ row = mysql_fetch_array($result))
{
if($c%$rows==$rows-1) echo "<br/>";
echo "< un href=\"details.php?id=$row[n] \ ">< clase de img = \"ads\"alt = \"$ fila [alt] \"título = \"$ fila [alt] \"src = \"$ fila [banner] \">< p / > $fila [alt]";
$c++;
$c++;
}
{
if($c%$rows==$rows-1) echo "<br/>";
echo "< un href=\"details.php?id=$row[n] \ ">< clase de img = \"ads\"alt = \"$ fila [alt] \"título = \"$ fila [alt] \"src = \"$ fila [banner] \">< p / > $fila [alt]";
$c++;
$c++;
}
Aquí es una alteración al bucle que debe trabajar para usted
PHP Código: [ 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++;
- }
Voy a adjuntar la información de prueba que tengo así. ADVERTENCIA usando esto no le ayudará como fuerza a información de la base de datos falsos darme resultados les proporciono como material de referencia sólo. Esto le dará una idea si los cambios resultantes son el efecto deseado.
Attachments:
- Anonymous
- Bot


- Registrado: 25 Feb 2008
- Mensajes: ?
- Loc: Ozzuland
- Status: Online
Enero 3rd, 2013, 8:13 am
1, 2
Para responder a este tema que necesita para ingresar o registrarse. Es gratis.
Publicar Información
- Total de mensajes en este tema: 18 mensajes
- Usuarios navegando por este Foro: No hay usuarios registrados visitando el Foro y 148 invitados
- No puede abrir nuevos temas en este Foro
- No puede responder a temas en este Foro
- No puede editar sus mensajes en este Foro
- No puede borrar sus mensajes en este Foro
- No puede enviar adjuntos en este Foro
