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


  • Home
  • Help
  • Search
  • Login
  • Register

  • WebsiteBaker Community Forum »
  • WebsiteBaker Support (2.8.x) »
  • Templates, Menus & Design »
  • Grabbing the WB menu from a non-WB php webpage
  • Print
Pages: [1]   Go Down

Author Topic: Grabbing the WB menu from a non-WB php webpage  (Read 5178 times)

SaBRENT

  • Guest
Grabbing the WB menu from a non-WB php webpage
« on: March 19, 2008, 06:59:07 PM »
Can anyone point me in the direction to pull a WB menu from a non-WB php webpage ?

Right now I am using file_get_contents() and preg_match() - I can't seem to get it to grab the whole menu it goes until a sub-menu page ends. this is what I am running:

Code: (php) [Select]

    function get_main_menu($regex,$content) 
    { 
        preg_match($regex,$content,$matches); 
        return $matches[1]; 
    }

    $hv_content = file_get_contents('http://www.yourdomain.com/home.php');
    $main_menu = get_main_menu('/ul id="menu">(.*)<\/ul>/isU',$hv_content); 

    echo"$main_menu";


Agian the menu i am trying to pull has Sub-menus maybe it can be done with the way I have shown but I am unsure of how to finish the phrase right.
Logged

  • Print
Pages: [1]   Go Up
  • WebsiteBaker Community Forum »
  • WebsiteBaker Support (2.8.x) »
  • Templates, Menus & Design »
  • Grabbing the WB menu from a non-WB php webpage
 

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