Sign in to follow this
Followers
0
-
Similar Content
-
By cdeese8
What's the best way to add a snippet of PHP inside a .tpl file? It looks like everybody recommends against using the {php}{/php} bracket for security reason. Should I be creating my .php snippet file in root WHMCS directory and just using include to beam it in?
{php} include "my-php-snippet.php"; {/php} I'm looking to "add recent wordpress posts to non wordpress site" and they all involve adding php snippet to include the wp-load.php file. It'd be cool if I can avoid using an <iframe> too. This is the snippet I'd like to add a .tpl page:
<?php // Include the wp-load'er include('/public_html/wordpress/wp-load.php'); // Get the last 10 posts // Returns posts as arrays instead of get_posts' objects $recent_posts = wp_get_recent_posts(array( 'numberposts' => 10 )); // Do something with them echo '<ul>'; foreach($recent_posts as $post) { echo '<li><a href="', get_permalink($post['ID']), '">', $post['post_title'], '</a></li>'; } echo '</ul>'; ?> * whmcs 7.4 is installed on root domain, and the wordpress site is installed in a subfolder
* https://davidwalsh.name/wordpress-recent-posts
* https://www.webmoves.net/blog/web-design-development/display-wordpress-posts-outside-of-wordpress-3081/
-
By ranojit
I have change php version 7.3 to 7.4 from cPanel. I also edit cron job command and change
opt/alt/php73/usr/bin/php -q /*****/****/****/crons/cron.php to
opt/alt/php74/usr/bin/php -q /*****/****/****/crons/cron.php
but I got error on system health check page on my WHMCS.
How can I solve this issue?
-
By amedeo
Hi,
I wrote an PHP utility for importing domains from an old administrative panel. The utility creates new order then confirm it. We were using nicIT for .it domains and ascio for the others tld; all worked fine, A few days ago we added internetbs and now when trying to create the order for .com domains (still managed by ascio) the AddOrder API returns a null response although the order is created and left in 'pending' status. With .it domains still works fine.
Any idea ? is it possible to get a sort of log where to look for the reason the API call does not work properly ?
-
By sebsimappus
Hello,
I come to you to see if anyone is how the scroll Stope at some point.
I joined the js code, in hope to have your help
thank you in advance
cordially
$(document).ready(function () { var $orderSummaryEl = jQuery("#scroll"); if ($orderSummaryEl.length) { var offset = jQuery("#scrollingPanelContainer").parent('.row').offset(); //var maxTopOffset = jQuery("#scrollingPanelContainer").parent('.row').outerHeight() - 35; var maxTopOffset = jQuery("#scrollingPanelContainer").parent('.row'); var topPadding = 15; jQuery(window).resize(function() { offset = jQuery("#scrollingPanelContainer").parent('.row').offset(); //maxTopOffset = jQuery("#scrollingPanelContainer").parent('.row').outerHeight() - 35; maxTopOffset = jQuery("#scrollingPanelContainer").parent('.row'); repositionScrollingSidebar(); }); jQuery(window).scroll(function() { repositionScrollingSidebar(); }); repositionScrollingSidebar(); } function repositionScrollingSidebar() { if (jQuery("#scrollingPanelContainer").css('float') != 'left') { $orderSummaryEl.stop().css('margin-top', '0'); return false; } var heightOfOrderSummary = $orderSummaryEl.outerHeight(); var newTopOffset = jQuery(window).scrollTop() - offset.top + topPadding; if (newTopOffset > maxTopOffset - heightOfOrderSummary) { newTopOffset = maxTopOffset - heightOfOrderSummary; } if (jQuery(window).scrollTop() > offset.top) { $orderSummaryEl.stop().animate({ marginTop: newTopOffset }); } else { $orderSummaryEl.stop().animate({ marginTop: 0 }); } } });
-
By twister
Hi guys,
I have a php file executing some mysql queries with variables parsed by Ajax , this is why i can't do the queries directly in php tags in the WHMCS template.
So basically there is a query.php file that i need to export the session variable to for further usage.
I need this variable in that file
{php}
echo $_SESSION['uid'];
{/php}
so i can use it for further manipulations.
-
-
Recently Browsing 0 members
No registered users viewing this page.