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.8 is now available!


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.


  • 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 5967 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