- //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
-
List of Free and Open Source CMS List of CMS (Content Management System), free and open source, written in PHP or other languages. Click on ...
-
Types of Encryption - Conventional Methods Encryption - Decryption: To carry sensitive information, such as military or financial data, a sy...
-
As a popular open source solution, Joomla has a very flexible architecture and ever more developers build various components and modules f...
-
To add a new menu which can hold menu items do the following: Log in to the Joomla! Administrator Back-end. Click Menus > Menu Manager ...
-
Joomla is the popular CMS which helps you create website easily. If you use Joomla as long enough to say you know everything about J...
-
In this SMF introductory installation tutorial, we will demonstrate how to install the Simple Machine Forums (SMF) program manually. A man...
-
photo by Castles, Capes & Clones/Flickr If you're doing custom design and development with Joomla! you need all of the tips an...
-
Installation CakePHP is simple and easy to install. The minimum requirements are a web server and a copy of CakePHP, that’s it! While this c...
-
Introduction This article provides detailed instructions for configuring a LAMPP server, not only for Joomla! it also should work fine for ...
-
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