Jump to content

techman41973

Members
  • Posts

    8
  • Joined

  • Last visited

Everything posted by techman41973

  1. Hi, I am using Mouseflow analytics in a phpbb forum. In my specific application, I need to add their application's javascript code inside php code. How do I properly add Javascript code inside a php code. Thanks This is how I would add it to an html file <script type="text/javascript"> var _mfq = _mfq || []; (function () { var mf = document.createElement("script"); mf.type = "text/javascript"; mf.async = true; mf.src = "//cdn.mouseflow.com/projects/b22343cd9-0049-4443-8326-954444462d6515.js"; document.getElementsByTagName("head")[0].appendChild(mf); })(); </script>
  2. I inherrited a site that has PHP code that decides to either serve the dedicated mobile site or desktop site to the user. I would prefer that tablets get served the mobile site. Currently Android tablet users get served the desktop site. I'd like to figure out how I can implement User Agent to detect an android tablet (with distinction from an Android phone) This is the code I'm working with to determine which site to serve (mobile or desktop) Thanks if ((strpos($user_agent, 'Mobile') === false && // Generic mobile browser string, most browsers have it. strpos($user_agent, 'SymbianOS') === false && // Nokia device running Symbian OS. strpos($user_agent, 'Opera M') === false && // Opera Mini or Opera Mobile. strpos($user_agent, 'Android') === false && // Android devices that don't have 'Mobile' in UA string. stripos($user_agent, 'HTC_') === false && // HTC devices that don't have 'Mobile' nor 'Android' in UA string. Case insensitive. strpos($user_agent, 'Fennec/') === false && // Firefox mobile strpos($user_agent, 'Kindle') === false && // Kindle Fire tablet strpos($user_agent, 'BlackBerry') === false) || // BlackBerry strpos($user_agent, 'iPad') === false) // iPad { // Serve Desktop Site return false; }
  3. Another related question, when the countdown reaches zero, how do I prevent it from showing a negatve number. Once the countdown reaches zero, I want to show a blank line or some specific text. Thanks again!
  4. I have a PHPBB based forum where I'd like to automatically generate a log file with some site statistics. every time there is a hit on a topic page (which runs a file named viewtopic.php), I want to generate a new line in this log file with the following info Date/Time, IP address, topic url For the sake of example, let's asume the variable names for these items are date_time, ip_address and topic_url This seems simple enough but I'm still new with PHP, I would appreciate some direction. Thanks Thanks
  5. I am hosting a forum running PHPBB software (written in PHP). I added a 3rd party modifiction to my forum, that allows the user to add a link to their facebook page in their profile. There is one line of code that checks the pattern of what the user enters in this text field, and displays an error if what the user enters doesn't meet the required pattern or format. I'm been frustrated trying to understand this line of code and the specific pattern it's testing for. I can't find any PHP reference page to help me intrerpret the pattern it's testing for and also help me change it to my preferred pattern. I'd like to modify the above line of code to reject any entry that doesn't begin with http://www.facebook.com/ I would greatly appreciate some help with this.
  6. I'm looking to develop PHP code for the following application, similar to a countdown timer. I want to compute the difference between the current date and the date of a future event (happens to be 1/7/2014). Easy to do. But I want to display the difference or time between the current date and this future event as follows ---- Event is x months and y weeks and z days from today I believe the best approach is to start with the datediff function, but it's the display output portion that gets tricky I would appreciate some help or direction. Thanks
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.