Php photo gallery TWG | JFUploader | TWG Flash upload | WFU | Forum

Get help for TinyWebGallery, the best image gallery. The forum is also home for the Joomla JFUploader, TWG Flash Uploader and the Wordpress flash uploader.
It is currently 29. Mar 2024, 00:10

This forum is readonly now. Please use the new forum if you don't find the answer to your question here. The new forum is at https://www.tinywebgallery.com/blog/forum/


All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: 17. Jun 2011, 14:57 
Offline

Joined: 23. Dec 2010, 21:01
Posts: 16
Hi Michael,

I have copied the database connection info from your "Database Plugin" into my new plugin I wrote. Since I know I will always been in Joomla v.1.5 or higher for this site, is it ok to delete some of the connection options in the If/Else statements. It would save some space in my code.

For example, can I just have this:

$joomla_config = dirname(__FILE__) . "/../../../../configuration.php";
include_once $joomla_config;
$jConfig = new JConfig();
$db_host = $jConfig->host;
$db_user = $jConfig->user;
$db_password = $jConfig->password;
$db_dbname = $jConfig->db;
$db_table = $jConfig->dbprefix . 'my_table';

instead of all of this ...

Current database connection info:

// if you use this in joomla 1.5 the values from joomla are used.
$joomla_config = dirname(__FILE__) . "/../../../../configuration.php";
if (file_exists($joomla_config)) {
include_once $joomla_config;
// we check if joomla 1.5.x or 1.0.x
if (class_exists("JConfig")) { // 1.5.x
$jConfig = new JConfig();
$db_host = $jConfig->host;
$db_user = $jConfig->user;
$db_password = $jConfig->password;
$db_dbname = $jConfig->db;
$db_table = $jConfig->dbprefix . 'joomla_flash_uploader_log';
} else { //1.0.x
$db_host = $mosConfig_host;
$db_user = $mosConfig_user;
$db_password = $mosConfig_password;
$db_dbname = $mosConfig_db;
$db_table = $mosConfig_dbprefix . 'joomla_flash_uploader_log';
}
} else {
// enter your db values below!
$db_host = 'localhost';
$db_user = 'root';
$db_password = '';
$db_dbname = 'joomla15';
$db_table = 'joomla_flash_uploader_log';
}

Thanks,
Tracy

Joomla 1.6.3
JFU 2.14
Server: localhost / development site


Top
 Profile  
 
PostPosted: 17. Jun 2011, 15:11 
Offline
Site Admin
User avatar

Joined: 1. Aug 2005, 12:53
Posts: 11232
Sure.

- Michael


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 12 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
cron
powered by phpbb | Datenschutz/ Privacy policy