- //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
-
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...
-
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...
-
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...
-
Try Joomla 3 Now! We’ve partnered with Siteground to provide a 90-day free Joomla! demo account . Get an instant Joomla website today! Try ...
-
CSS3 Animations With CSS3, we can create animations, which can replace animated images, Flash animations, and JavaScripts in many web pages....
-
As a PHP developer, we often get bored with one PHP framework and looks for some advanced feature rich framework which can make life easie...
-
WEBDEC Technologies The penetration of web and digital media into every aspect of people’s lives has caused fundamental changes in how peo...
Powered by Blogger.
0 comments:
Post a Comment