WebsiteBaker Logo
  • *
  • Templates
  • Help
  • Add-ons
  • Download
  • Home
*
Welcome, Guest. Please login or register.

Login with username, password and session length
 

News


WebsiteBaker 2.13.6 is now available!


Will it continue with WB? It goes on! | Geht es mit WB weiter? Es geht weiter!
https://forum.websitebaker.org/index.php/topic,32340.msg226702.html#msg226702


The forum email address board@websitebaker.org is working again
https://forum.websitebaker.org/index.php/topic,32358.0.html


R.I.P Dietmar (luisehahne) and thank you for all your valuable work for WB
https://forum.websitebaker.org/index.php/topic,32355.0.html


* Support WebsiteBaker

Your donations will help to:

  • Pay for our dedicated server
  • Pay for domain registration
  • and much more!

You can donate by clicking on the button below.

Donate with PayPal buttonSpenden mit dem PayPal-Button

  • Home
  • Help
  • Search
  • Login
  • Register

  • WebsiteBaker Community Forum »
  • WebsiteBaker Support (2.8.x) »
  • Templates, Menus & Design »
  • Check a page is in a certain menu (menu in array?)
  • Print
Pages: [1]   Go Down

Author Topic: Check a page is in a certain menu (menu in array?)  (Read 3531 times)

Indextra

  • Guest
Check a page is in a certain menu (menu in array?)
« on: December 17, 2010, 04:11:20 PM »
Hello,

I have 2 menu's on my site. Is there a possibilty to check that a certain page is in a certain menu? This could very easily be done if the menu could be loaded in an array. However this is not possible, as far as I know.
Has someone an idea?

Greets,
Remi
Logged

Offline Stefek

  • Posts: 6177
  • Gender: Male
  • ("ړ)
Re: Check a page is in a certain menu (menu in array?)
« Reply #1 on: December 17, 2010, 04:28:12 PM »
Hello,

I don't know what the exact purpose of this is..
but you could create your own function selecting the pages directly from the database.

Just look at the table TABLE_PREFIX.'pages in the database.

Regards,
Stefek
Logged
"Gemeinsam schafft man mehr."

gemeinsam
1. mehreren Personen oder Dingen in gleicher Weise gehörend, eigen
2. in Gemeinschaft [unternommen, zu bewältigen]; zusammen, miteinander
#Duden

Indextra

  • Guest
Re: Check a page is in a certain menu (menu in array?)
« Reply #2 on: December 21, 2010, 04:13:28 PM »
Thank you!

If someone is wondering I used the following code:
Code: [Select]
<?php
$menunum 
= false;
$rslt = mysql_query(&#39;SELECT menu FROM &#39;.TABLE_PREFIX.&#39;pages WHERE page_id = \&#39;&#39;.PAGE_ID.&#39;\&#39;&#39;);
if(mysql_num_rows($rslt)>0){
while($row = mysql_fetch_array($rslt)){
$menunum = $row[&#39;menu&#39;] ;
}
}
?>
Logged

Offline Stefek

  • Posts: 6177
  • Gender: Male
  • ("ړ)
Re: Check a page is in a certain menu (menu in array?)
« Reply #3 on: December 21, 2010, 04:26:27 PM »
Cool,

you could use WBs own Class database "get_one" Methode to short your code:

Code: [Select]

$menunum= $database->get_one('SELECT menu FROM '.TABLE_PREFIX.'pages WHERE page_id = \''.PAGE_ID.'\'');


Regards,
Stefek
Logged
"Gemeinsam schafft man mehr."

gemeinsam
1. mehreren Personen oder Dingen in gleicher Weise gehörend, eigen
2. in Gemeinschaft [unternommen, zu bewältigen]; zusammen, miteinander
#Duden

  • Print
Pages: [1]   Go Up
  • WebsiteBaker Community Forum »
  • WebsiteBaker Support (2.8.x) »
  • Templates, Menus & Design »
  • Check a page is in a certain menu (menu in array?)
 

  • SMF 2.0.19 | SMF © 2017, Simple Machines
  • XHTML
  • RSS
  • WAP2