• 17-05-2008, 17:43:20
    #1
    vys
    Üyeliği durduruldu
    merhaba arkadaşlar,


    elimde bir kod var ve menü functions.js ile birleştirilmiş şimdi siteye attığım zaman linkler page.php?id=1 şeklinde oluyor şimdi ben yeni bir sayfa eklemek istersem başlığını ne yapmam gerekiyor? yani

    page.php?id=1 bu sayfaya gitmesi için 1.php mi yapayım dosya adını (yaptım ama olmadı)

    kod
    <SCRIPT type=text/javascript>
    							showMenuItem(1, 'Ana Sayfa', 1);showMenuItem(2, 'Hakkımızda', 1);showMenuItem(3, 'Yer Listesi', 1);showMenuItem(4, 'Vizyonumuz', 1);showMenuItem(5, 'Misyonumuz', 1);showMenuItem(6, 'Reklamcılık', 1);showMenuItem(7, 'Portföy', 1);showMenuItem(8, 'Bilgi Formu', 1);showMenuItem(9, 'İletişim', 0);							</SCRIPT>
    ne yapmam gerekiyor yardımcı olurmusunuz
  • 17-05-2008, 17:54:24
    #2
    page.php ve js dosyasının içeriğini buraya yazarmısın.
  • 17-05-2008, 18:47:43
    #3
    vys
    Üyeliği durduruldu
    page.php de pek bir şey yok sadece tasarım

    js dosyasını veriyorum

    function showInfoForm(currentPage)
    {
    	document.write('<form action="send.php?type=info&id=' + currentPage + '" method="post">');
    	document.write('<table border="0" cellspacing="0" cellpadding="0">');
    	document.write('<tr><td class="tx">Isim Soyad</td><td width="10"></td><td><input class="tit_kurumsal" type="text" name="name" size="24" /></td></tr>');
    	document.write('<tr><td class="tx">Firma Adi</td><td width="10"></td><td><input class="tit_kurumsal" type="text" name="company" size="24" /></td></tr>');
    	document.write('<tr><td class="tx">Telefon (is)</td width="10"><td></td><td><input class="tit_kurumsal" type="text" name="phone" size="24" /></td></tr>');
    	document.write('<tr><td class="tx">Telefon (fax)</td width="10"><td></td><td><input class="tit_kurumsal" type="text" name="fax" size="24" /></td></tr>');
    	document.write('<tr><td class="tx">Telefon (ev)</td width="10"><td></td><td><input class="tit_kurumsal" type="text" name="home" size="24" /></td></tr>');
    	document.write('<tr><td class="tx">Adres</td><td></td width="10"><td><textarea class="tit_kurumsal" name="address" rows="4" cols="40"></textarea></td></tr>');
    	document.write('<tr><td class="tx">Email</td><td></td width="10"><td><input class="tit_kurumsal" type="text" name="email" size="24" /></td></tr>');
    	document.write('<tr><td class="tx">Ilgilenilen Konu</td><td width="10"></td><td><input class="tit_kurumsal" type="text" name="subject" size="24" /></td></tr>');
    	document.write('<tr><td class="tx">Konu</td><td width="10"></td><td><textarea class="tit_kurumsal" name="message" rows="4" cols="40"></textarea></td></tr>');
    	document.write('<tr><td></td><td width="10"></td><td></td></tr>');
    	document.write('<tr><td></td><td width="10"></td><td><input type="submit" name="submit" value="Gönder" /></td></tr>');
    	document.write('</table></form>');
    }
    
    function showMenuItem(id, name, hasSeperator)
    {
    	document.write('<td height="30" align="center"><table border="0" style="border-collapse: collapse" cellpadding="0">');
    	document.write('<tr><td width="12">&nbsp;</td><td><a class="mnu1" href="page.php?id=' + id + '">' + name + '</a></td>');
    	document.write('<td width="12">&nbsp;</td></tr></table></td>');
    	
    	if(hasSeperator == 1)
    		document.write('<td height="30" bgcolor="#2B76CE" width="1"><img border="0" src="img/1px.gif" width="1" height="1"></td>');
    }
    
    function startSubMenu(title)
    {
    	document.write('<table border="0" style="border-collapse: collapse" width="100%" cellpadding="0">');
    	document.write('<tr><td height="12" bgcolor="#008588"><img border="0" src="img/1px.gif" width="1" height="1"></td></tr>');
    	document.write('<tr><td height="68" valign="bottom"><table border="0" style="border-collapse: collapse" width="100%" cellpadding="0">');
    	document.write('<tr><td width="15">&nbsp;</td><td align="right"><p class="slogan2">' + title + '</p></td>');
    	document.write('<td width="15">&nbsp;</td></tr></table></td></tr><tr><td>&nbsp;</td></tr><tr>');
    	document.write('<td bgcolor="#44ECFF"><img border="0" src="img/1px.gif" width="1" height="1"></td></tr>');
    }
    
    function endSubMenu()
    {
    	document.write('<tr><td>&nbsp;</td></tr><tr><td>&nbsp;</td></tr><tr><td>&nbsp;</td></tr></table>');
    }
    
    function showSubMenuItems(id, lid, name, hasProducts, isActive)
    {
    	var link = '';
    	if(hasProducts == 1)
    		link = 'page.php?cat=' + id + '&lid=' + lid;
    	else if(hasProducts == 2)
    		link = 'page.php?ref=' + id + '&lid=' + lid;
    	else
    		link = 'page.php?id=' + id + '&lid=' + id;
    	
    	if(id == -1)
    		link = 'news.php';
    	if(isActive == 1)
    	{
    		document.write('<tr><td bgcolor="#00E2E8" height="20"><table border="0" style="border-collapse: collapse" width="100%" cellpadding="0">');
    		document.write('<tr><td width="5">&nbsp;</td><td><p class="mnu2of"><img border="0" src="img/ico_ok_alt_mnu3.gif" width="18" height="9" />');
    		document.write('<a class="mnu2of" href="' + link + '">' + name + '</a>');
    		document.write('</p></td><td width="10">&nbsp;</td></tr></table></td></tr>');
    	}
    	else
    	{
    		document.write('<tr><td height="20"><table border="0" style="border-collapse: collapse" width="100%" cellpadding="0">');
    		document.write('<tr><td width="5">&nbsp;</td><td><p class="mnu2"><img border="0" src="img/ico_ok_alt_mnu3.gif" width="18" height="9" />');
    		document.write('<a class="mnu2" href="' + link + '">' + name + '</a>');
    		document.write('</p></td><td width="10">&nbsp;</td></tr></table></td></tr>');
    	}
    	document.write('<tr><td bgcolor="#44ECFF"><img border="0" src="img/1px.gif" width="1" height="1"></td></tr>');
    }
    
    function showNewsOnIndex(firstNewsId, firstNews, secondNewsId, secondNews)
    {
    	document.write('<table border="0" style="border-collapse: collapse" width="100%" id="table35" cellpadding="0">');
    	document.write('<tr><td width="20" height="10"></td><td height="10"></td><td width="20" height="10"></td></tr>');
    	document.write('<tr><td width="20">&nbsp;</td><td class="tit_haber">Haberler</td><td width="20">&nbsp;</td></tr>');
    	document.write('<tr><td width="20"><img border="0" src="img/1px.gif" width="1" height="1"></td><td bgcolor="#00DADF">');
    	document.write('<img border="0" src="img/1px.gif" width="1" height="1"></td><td width="20"><img border="0" src="img/1px.gif" width="1" height="1"></td></tr>');
    	document.write('<tr><td width="20"><img border="0" src="img/1px.gif" width="1" height="1"></td><td bgcolor="#009295"><img border="0" src="img/1px.gif" width="1" height="1"></td>');
    	document.write('<td width="20"><img border="0" src="img/1px.gif" width="1" height="1"></td></tr>');
    	document.write('<tr><td width="20" height="7"></td><td height="7"></td><td width="20" height="7"></td></tr>');
    	if(firstNewsId != 0 || firstNewsId != null) 
    	{
    		document.write('<tr><td width="20">&nbsp;</td><td><p class="tx_haber">');
    		document.write('<a class="tx_haber" href="news.php?id=' + firstNewsId + '">' + firstNews + '</a>');
    		document.write('</td><td width="20">&nbsp;</td></tr>');
    	}
    	document.write('<tr><td width="20" height="15"></td><td height="15"></td>');
    	document.write('<td width="20" height="15"></td></tr>');
    	if(secondNewsId != 0 || secondNewsId != null) 
    	{
    		document.write('<tr><td width="20">&nbsp;</td><td><p class="tx_haber">');
    		document.write('<a class="tx_haber" href="news.php?id=' + secondNewsId + '">' + secondNews + '</a>');
    		document.write('</td><td width="20">&nbsp;</td></tr>');
    	}
    	document.write('</table><div align="right"><a href="news.php" class="tit_haber">tüm haberler..</a>&nbsp;</div>');
    }
    
    function showFooter(address, phone, fax, email, apLogo, siteFooter, isIndex)
    {
    	document.write('<td width="50">&nbsp;</td><td width="720" bgcolor="#142863" valign="top"><table border="0" style="border-collapse: collapse" width="100%" id="table36" cellpadding="0">');
    	document.write('<tr><td width="20" height="17"></td><td height="17"></td><td width="150" height="17"></td><td width="20" height="17"></td></tr>');
    	document.write('<tr><td width="20">&nbsp;</td><td><p class="mnu1"><u>Adres:</u> ' + address + '<br><img border="0" src="img/1px.gif" width="3" height="3"><br>');
    	document.write('<u>Tel:</u> ' + phone + '<br><img border="0" src="img/1px.gif" width="3" height="3"><br><u>Fax:</u> ' + fax + '<br><img border="0" src="img/1px.gif" width="3" height="3"><br>');
    	document.write('<u>E-posta:</u> <a class="mnu1" href="mailto:' + email + '">' + email + '</a></td><td width="150" align="right" valign="top">');
    
    	if(isIndex == 1) 
    	{
    		document.write('<p class="ap">' + apLogo + '</p>');
    	}
    	else
    	{
    		document.write('<table border="0" style="border-collapse: collapse" id="table53" cellpadding="0"><tr>');
    		document.write('<td width="15" height="21">&nbsp;</td><td width="60" height="21" bgcolor="#152D6A" align="center">');
    		document.write('<a class="tx_lnk" href="index.php">ana sayfa</a></td><td width="10" height="21">&nbsp;</td>');
    		document.write('<td width="50" bgcolor="#152D6A" align="center" height="21"><a class="tx_lnk" href="#top">yukari</a>');
    		document.write('</td></tr></table>');
    	}
    
    	document.write('</td><td width="20">&nbsp;</td></tr><tr><td width="20" height="10"></td><td height="10"></td><td width="150" height="10"></td><td width="20" height="10"></td></tr>');
    	document.write('<tr><td width="20">&nbsp;</td><td><p class="tit_haber">' + siteFooter + '</td><td width="150">&nbsp;</td><td width="20">&nbsp;</td></tr><tr><td width="20">&nbsp;</td><td>&nbsp;</td>');
    	document.write('<td width="150">&nbsp;</td><td width="20">&nbsp;</td></tr></table></td><td>&nbsp;</td>');
    }
    
    function showTop(showLink)
    {
    	document.write('<tr><td width="50" height="40">&nbsp;</td><td width="720" bgcolor="#142863" height="40" align="right">');
    	document.write('<table border="0" style="border-collapse: collapse" cellpadding="0"><tr><td width="30">&nbsp;</td><td>');
    	if(showLink == 1)
    		document.write('<a class="mnu1" href="index.php">ana sayfa</a>');
    	document.write('</td><td width="20">&nbsp;</td></tr></table></td><td height="40">&nbsp;</td></tr>');
    }
    
    function showLogo(file)
    {
    	document.write('<tr><td height="94"><table border="0" style="border-collapse: collapse" cellpadding="0">');
    	document.write('<tr><td width="30">&nbsp;</td><td class="logo"><img src="img/');
    	document.write(file);
    	document.write('" /></td></tr></table></td></tr>');
    }
    
    function showNews(title, body, date)
    {
    	document.write('<p class="tx"><b>' + title + '</b><br /><span class="tit_haber">' + date + '</span><br />' + body + '</p>');
    }
    
    function listNews(id, title, body, date)
    {
    	document.write('<p class="tx"><a class="tx" href="news.php?id=' + id + '"><b>' + title + '</b></a><br />');
    	document.write('<span class="tit_haber">' + date + '</span><br />' + body + '</p>');
    }
    
    function openWindow(theURL,winName,features) 
    {
    	window.open(theURL,winName,features);
    }
  • 17-05-2008, 19:25:56
    #4
    vys
    Üyeliği durduruldu
    yardımcı olacak kimse yok mu acaba ?
  • 17-05-2008, 19:35:19
    #5
    olay page.php de bitiyor
    büyük ihtimalle veriler db den çekiliyor.js dosyasına göre fonksiyonun kullanımı böyle.
    showMenuItem(id, name, hasSeperator)
    yeni menüyü
    showMenuItem(idnumarası, 'Yeni Sayfa', 1)
    burada olay sadece page.php ye id numarasını yolluyor. page dosyasına o id yi işliyor veya db den çekip gösteriyor.
  • 17-05-2008, 19:37:50
    #6
    vys
    Üyeliği durduruldu
    peki hocam bunu nasıl değiştirebiliriz swishlerle filan olmaz mı elle girsek ?
  • 17-05-2008, 19:52:31
    #7
    page.php deister dbden çekersiniz ister switch veya iflerle yapabilirsiniz.
    page.php de:
    <?php
    $id=$_GET['id'];
    if ($id==1)
    {
    include("anasayfa.php"),;
    }elseif ($id==2)
    {
    include("aaa.php");
    }
    .
    .
    .
    }else{ include("hata.php"); }
    ?>

    gibi kodlarla konttrol yaparak istediğiniz sayfayı ekranda gösterebilirsiniz.
  • 17-05-2008, 20:08:56
    #8
    vys
    Üyeliği durduruldu
    şimdi hocam php de yeniyim

    <SCRIPT type=text/javascript>
                                showMenuItem(1, 'Ana Sayfa', 1);showMenuItem(2, 'Hakkımızda', 1);showMenuItem(3, 'Yer Listesi', 1);showMenuItem(4, 'Vizyonumuz', 1);showMenuItem(5, 'Misyonumuz', 1);showMenuItem(6, 'Reklamcılık', 1);showMenuItem(7, 'Portföy', 1);showMenuItem(8, 'Bilgi Formu', 1);showMenuItem(9, 'İletişim', 0);                            </SCRIPT>
    şu kodların yerine ne yazarsam elle yapabilirim lütfen yardımcı olurmusunuz?
  • 17-05-2008, 20:16:54
    #9
    oraya yanlarına ekleyeceksin.
    Alıntı
    showMenuItem(idnumarası, 'Yeni Sayfa', 1);