[ eskim @ 24.09.2003. 11:41 ] @
Za mene najlakshi nachin da nauchim neshto je po sistemu pokushaja/greshaka sve dok ne sviknem kako to radi zato postavljam ovakav post,

imam ovu jednostavnu scriptu za site navigaciju interesuje me kako chu da stavim sliku umjesto slova koja je link prema drugoj stranici znachi ja hochu da kliknem na sliku umjesto na slova da bih otvorio drugu stranicu, vidim ovdje da se koriste array-i i chitao sam neshto o njihovim funkcijama ali mi nije jasno kako implemetniram sliku zajedno sa njim, btw nashao sam na netu tonu komandi za manipulaciju sa slikom ali ne i to shto mi treba ja mislim da je kranje jednostavno

<?

// menunav.php - use as include on each page.
// by jamie dyer
// see example at http://www.hogwaller.com

// First array. It contains the page names, which appear on the page.

$name = array ("&nbsp;/",
"Page 1",
"Page 2",
"Page 3",
"Page 4",
"Page 5",
"Page 6",
"Page 7",
"Page 8",
"Page 9",
"Page 10");

// Second array. It contains the actual .php pages.

$url = array ("/",
"page1.php",
"page2.php",
"page3.php",
"page4.php",
"page5.php",
"page6.php",
"page7.php",
"page8.php",
"page9.php",
"page10.php");

// Third array. Optional. It contains the title tags.

$title = array ("Top of Site",
"This is Page 1",
"This is Page 2",
"This is Page 3",
"This is Page 4",
"This is Page 5",
"This is Page 6",
"This is Page 7",
"This is Page 8",
"This is Page 9",
"This is Page 10");

// Set the requested page. It will be used to "unlink" if true.

$file = basename($_SERVER['REQUEST_URI']);

// Set the referer. Used for the "Previous Page" link.

$back = $_SERVER['HTTP_REFERER'];

/* Count the number of elements in the $name array, and iterate through the elements. The number of elements in the three arrays ($name, $url, $title) must match. */

$namecount = count($name);
for ($i = 0; $i < $namecount; $i++)
{

// If current .php page being iterated matches requested page, "unlink" it.

if ($url[$i] == $file)
{
echo ("<a class=\"nolink\" title=\"You Are Here\">$name[$i]</a><br>");

}

// Otherwise, make it a live link.

else
{
echo ("<a href=\"$url[$i]\" title=\"$title[$i]\">$name[$i]</a><br>");
}
}
echo ("<br>");

// As long as the referer and the current page don't match, make a "Previous page" link.

if ($back !== $file)
{
echo ("<a href=\"$back\">Previous Page</a><br>");
}

preuzeto sa hotscripts.com


?>
[ Nub.Saibot @ 24.09.2003. 12:15 ] @
Treba da namestis umesto niza sa imenima strana, niz sa putanjama do slika koje ce se prikazivati umesto imena.

// If current .php page being iterated matches requested page, "unlink" it.

if ($url[$i] == $file)
{
echo ("<img src=\"$slike[$i]\"><br>");

}

// Otherwise, make it a live link.

else
{
echo ("<a href=\"$url[$i]\" title=\"$title[$i]\"><img src=\"$slike[$i]\"></a><br>");
}
}
echo ("<br>");

// As long as the referer and the current page don't match, make a "Previous page" link.

if ($back !== $file)
{
echo ("<a href=\"$back\"><img src=\"SlikaZaPreviousPage.jpg\"></a><br>");
}

Pozdrav
[ eskim @ 24.09.2003. 14:15 ] @
Super ti mi je tachno i trebalo puno hvala, samo josh jedna stvar mogu li kako da izbjegnem okvir oko slika to je kao underline link kao u html codu?
[ Nub.Saibot @ 24.09.2003. 15:22 ] @
Nisam siguran da sam shvatio sta je u pitanju. Ali da pokusam.

<img border=\"0\" src=\"$slike[$i]\">

Ovo bi trebalo da ukloni okvir oko slike.

Pozdrav
[ eskim @ 29.09.2003. 11:15 ] @
to je to sve sam uradio shta mi je trebali josh malo da zavrshim i shaljem link da pogledate nashta lichi, hvala