Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Calling MySQL database in paper_lantern

Discussion in 'User Experience' started by timmmmyboy, Jul 14, 2015.

  1. timmmmyboy

    timmmmyboy Member

    Joined:
    Aug 26, 2013
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    I'm trying to integrate a piece of javascript code into paper_lantern and for a few parts of it I'll need to pull information from our client management database. I'm very familiar with connecting to a MySQL database using PHP but it seems like paper_lantern is all HTML so I'm at a loss as to how to get the data I need from a database for use in the template. Since I need this code to live in the footer of every page I can't just create a custom page that uses PHP. What are the best ways of doing this?
     
  2. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,803
    Likes Received:
    1,898
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello :)

    You could elaborate on the type of database content you are attempting to add to the footer through a PHP script? I'm not certain that it's going to work if you need it in the footer instead of as a plugin. Note that you may find this document helpful:

    Customize Content in Paper Lantern


    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. timmmmyboy

    timmmmyboy Member

    Joined:
    Aug 26, 2013
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Hey Michael,

    I appreciate you responding! I only just now saw this (must have notifications turned off here for some reason). Essentially we have to do a database call to get a unique customer ID from our billing system to match up with a piece of javascript we need to insert (we're using Intercom and the javascript embed requires that unique customer ID which currently only resides in our billing system's database). Never took a stab at building a plugin before but perhaps that's the best route. Or alternatively I may look into other ways to get that one piece of information for the embed without having to do a database call (have to think through what that might look like).
     
  4. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,803
    Likes Received:
    1,898
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice