<?php
if ($GLOBALS['user']->uid)
{
echo $GLOBALS['user']->uid;
} ?>
Enjoy Drupaling.
Cheers!
This blog will give you all kind of Open Source help like Drupal, Zend, Symfony, Joomla and Magento.
<?php
if ($GLOBALS['user']->uid)
{
echo $GLOBALS['user']->uid;
} ?>
Enjoy Drupaling.
Cheers!
Hi All,
Use the following URL to login
http://localhost/magento/index.php/admin
if does not work then use the another way to login
OR
Open Varien.php file using the following path:
app\code\core\Mage\Core\Model\Session\Abstract\Varien.php
find the below given code in above file: if (isset($cookieParams['domain'])) { $cookieParams['domain'] = $cookie->getDomain();
}
Replace If condition with the below if condition:
if (isset($cookieParams['domain']) && !in_array("127.0.0.1", self::getValidatorData())) {
And done!
Cheers!
# Minute Hour Day of Month Month Day of Week Command # (0-59) (0-23) (1-31) (1-12 or Jan-Dec) (0-6 or Sun-Sat) 0 2 12 * 0,6 /usr/bin/php /vr/www/html/vpe/mail.php
30 23 * * * /usr/bin/php /var/www/html/vpe/mail.php that means above cron will run daily at 23:30 i.e., 11:30 PMand you'r done.
Please use the following code to call ajax:
function updateStatus() { $.ajax({ url: 'getStatus.php', success: function(response) { // update status element $('#status').html(response); } }); }
Cheers!
// Disable #divID $("#divID").attr("disabled","disabled");
// Enable #divID $("#divID").removeAttr("disabled");
Cheers!
var isVisible = $('#myDiv').is(':visible'); var isHidden = $('#myDiv').is(':hidden');
Here is() function is used to check whether div is visible or not.
Cheers!
if( $('#myDiv').length > 0 ) $('#myDiv').show();
$(document).ready(function(){ // Your code here });
$(document).ready(function() {
$("a").click(function(event){ alert("Thanks for visiting!"); });
});
This function will work until or unless page will be loaded properly.
Use the following code to add js in drupal:
<?php
// This will add a JS file to your head (specifically the $scripts variable in page.tpl.php)
drupal_add_js(drupal_get_path('module', 'my_module') . '/my_module.js');
// This add inline JS to the head of the document
drupal_add_js('alert("Hello!")', 'inline');
// This will add variables in the Drupal.settings object
drupal_add_js(array('my_module' => array('my_setting' => 'this_value')), 'setting');?>
Enjoy Drupaling!
Cheers!
mysite
/application
/controllers
IndexController.php
/models
IndexModel.php
/forms
LoginForm.php
/views
/scripts
/index
index.phtml
/libaray
/Zend
/js
/css
/images
/index.phtm
<?php define('ROOT_DIR', dirname(__FILE__)); set_include_path('.' . PATH_SEPARATOR . ROOT_DIR . '/library' . PATH_SEPARATOR . ROOT_DIR . '/application/models' . PATH_SEPARATOR . ROOT_DIR . '/application/forms' . PATH_SEPARATOR . get_include_path() ); require_once "Zend/Loader.php"; Zend_Loader::registerAutoload(); $frontController = Zend_Controller_Front::getInstance(); $frontController->throwExceptions(true); $frontController->setControllerDirectory(ROOT_DIR.'/application/controllers'); $frontController->dispatch(); ?>
<?php class IndexController extends Zend_Controller_Action { public function indexAction() { } }
Now if you browse
http://localhost/mysite/
You will see
Hello World
If you don’t see “Hello world” printed, read the above guide lines again.
As
we have now successfully created directory structure and bootstrap
file, its time to make other necessary configuration for database.
4. Configuration for working with database
How
a web application can be completed without usage of database. Different
web application uses different database. Some uses Mysql, other SQLite,
SQL server and Oracle. One of the nice thing about Zend Framework is
that it support multiple database servers.
Here we are going to making configuration for Mysql server.
For database configuration, first create config.ini in mysite/application/ and write the following code in it.
[general] db.adapter = PDO_MYSQL db.params.host = localhost db.params.username = root db.params.password = db.params.dbname = zend_framework
<?php define('ROOT_DIR', dirname(__FILE__)); set_include_path('.' . PATH_SEPARATOR . ROOT_DIR . '/library' . PATH_SEPARATOR . ROOT_DIR . '/application/models' . PATH_SEPARATOR . ROOT_DIR . '/application/forms' . PATH_SEPARATOR . get_include_path() ); require_once "Zend/Loader.php"; Zend_Loader::registerAutoload(); $config = new Zend_Config_Ini(ROOT_DIR.'/application/config.ini', 'general'); $db = Zend_Db::factory($config->db); Zend_Db_Table::setDefaultAdapter($db); $frontController = Zend_Controller_Front::getInstance(); $frontController->throwExceptions(true); $frontController->setControllerDirectory(ROOT_DIR.'/application/controllers'); $frontController->dispatch(); ?>
'; print_r($vars); print '';*/
'; print_r($vars); print '';*/
'; print_r($vars); print '';*/