Welcome, Guest. Please login or register.
Did you miss your activation email?
May 26, 2012, 01:48:19 PM

Login with username, password and session length
Search:     Advanced search
Interested in joining the WebsiteBaker team?
For more Information read here or on our new website.
155539 Posts in 21712 Topics by 7737 Members
Latest Member: deanmacullam
* Home Help Search Login Register
Pages: [1]   Go Down
Print
Author Topic: Check a page is in a certain menu (menu in array?)  (Read 338 times)
Indextra

Offline Offline

Posts: 2


« 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
Stefek
WebsiteBaker Org e.V.

Offline Offline

Posts: 4884



« 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

"In a time of universal deceit, telling the truth becomes a revolutionary act."
- George Orwell, Nineteen eighty-four (1984)
Indextra

Offline Offline

Posts: 2


« Reply #2 on: December 21, 2010, 04:13:28 PM »

Thank you!

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

Offline Offline

Posts: 4884



« 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:

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


Regards,
Stefek
Logged

"In a time of universal deceit, telling the truth becomes a revolutionary act."
- George Orwell, Nineteen eighty-four (1984)
Pages: [1]   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!