- //init Joomla Framework
- define( '_JEXEC', 1 );
- define( 'JPATH_BASE', realpath(dirname(__FILE__).'/../..' )); // print this out or observe errors to see which directory you should be in (this is two subfolders in)
- define( 'DS', DIRECTORY_SEPARATOR );
- require_once ( JPATH_BASE .DS.'includes'.DS.'defines.php' );
- require_once ( JPATH_BASE .DS.'includes'.DS.'framework.php' );
- require_once ( JPATH_CONFIGURATION .DS.'configuration.php' );
- require_once ( JPATH_LIBRARIES .DS.'joomla'.DS.'database'.DS.'database.php' );
- require_once ( JPATH_LIBRARIES .DS.'import.php' );
- //DB Connection
- $Config = new JConfig();
- $db_driver = $Config->dbtype; // Database driver name
- $db_host = $Config->host; // Database host name
- $db_user = $Config->user; // User for database authentication
- $db_pass = $Config->password; // Password for database authentication
- $db_name = $Config->db; // Database name
- $db_prefix = $Config->dbprefix; // Database prefix (may be empty)
- // Database prefix (if empty then remove prefixing double underscore)
- $db_prefix = (trim($db_prefix)=="") ? "":$db_prefix;
- $db_connect = mysqli_connect($db_host,$db_user,$db_pass);
- $content_count = 0;
- // CONNECTED! so run a SQL query as per usual
- if (!mysqli_connect_errno()) {
- $query='SELECT COUNT(*) as ArticleCount FROM `'.$db_prefix.'content` WHERE id='.mysqli_real_escape_string($db_connect, $_GET['id']);
- if ($result = mysqli_query($db_connect, $query, MYSQLI_USE_RESULT)) {
- while($obj = $result->fetch_object()){
- $content_count = $obj->ArticleCount;
- }
- }
- }
- echo $content_count;
- mysqli_free_result( $db_connect );
.
Monday, 15 December 2014
Subscribe to:
Post Comments (Atom)
.
Popular Posts
-
Joomla is one of the most popular Content Management Systems (CMS) in the world, used in over 30 million sites, with over 200,000 communi...
-
You can follow these instructions if you need to manually perform a phpBB installation for your web site. Note that you should skip this s...
-
Conversion rates actually increase if you use other terminology for the button text. According to Hubspot , you can increase your convers...
-
One of the most essential things in making your website live, up-to-date, and attractive for your followers is a forum. With for...
-
First of all, you may want to check which version of Joomla! is running on your website. Check for the latest Joomla! CMS version. If you a...
-
Drupal admin and configuration: Create a "HTML help" block and assign it to appear on only "node/*/edit" and "nod...
-
Window Management Drag Off Floating Tab Wells Ctrl+click for multi-select Maximize Floating Window Double-click on title bar Re-d...
-
Types of Encryption - Conventional Methods Encryption - Decryption: To carry sensitive information, such as military or financial data, a sy...
-
In this SMF introductory installation tutorial, we will demonstrate how to install the Simple Machine Forums (SMF) program manually. A man...
-
Simple Login logout system using php Login and logout system is the most important thing for the user management, session management is on...
Powered by Blogger.
0 comments:
Post a Comment