<?php
//The following code will load the block with the given "identifier"
// on the phtml page
echo $this->getLayout()->createBlock('cms/block')->
setBlockId('identifier')->toHtml()
?>
Monthly Archives: March 2011
How to give Image path in cms page /blocks
To give image path you can use {{skin url=’yourimage.gif’}} .
How to get site URL – Magento
You can use the following function to get site urls .
Below given are the function with different arguments
Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_JS) – http://magesite.extension/js/
Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK) – http://magesite.extension/index.php/
Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA) – http://magesite.extension/media/
Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN) – http://magesite.extension/skin/
Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB) -http://magesite.extension/
$currentUrl = $this->helper('core/url')->getCurrentUrl(); // Displays URL of the current page
How to include custom JavaScript from skins folder – Magento
Please include the following line in page.xml page to include js file from the your theme folder
<action method=”addItem”><type>skin_js</type>filename.js</action>
The path will be www.yourSiteName.com/skin/frontend/mind/extreme/js/filename.js
How to include custom JavaScript from skins folder – Magento
Please include the following line in page.xml page to include js file from the your theme folder
<action method=”addItem”><type>skin_js</type><script>filename.js</script></action>
The path will be www.yourSiteName.com/skin/frontend/mind/extreme/js/filename.js
Image path in phtml files – Magento
<?php echo $this->getSkinUrl(‘images/your_image_name.jpg’) ?>
The function will return the full path of the image given as parameter .
Create a new package/theme – Magento
Please follow the link
http://fishpig.co.uk/create-a-custom-theme-in-magento-1-4/comment-page-1/#comment-1185
Create a new package/theme
Please follow the link
http://fishpig.co.uk/create-a-custom-theme-in-magento-1-4/comment-page-1/#comment-1185
Script to automatically delete a user – VBulletin
1)Create a file with desired name (let it be vb_delete.php) with the following code
require_once(‘class.forumops.php’);
$clientdata = unserialize($_POST[‘post’]);
$forum = new ForumOps();
$errmsg = $forum->delete_user($clientdata[‘username’]);
if ($errmsg) echo $errmsg;
else echo “User deleted successfully.
n”;
NOTE :You can download the script using the url http://wp.me/p1aZaf-1d
2)Upload the file to the server the vBulletin installed
3)Paste the below given code , immediately after the code that update the user details .
$clientdata = array( ‘username’ => $username);
$url=”http://www.example.com/forum/vb_delete.php”;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt ($ch, CURLOPT_POST, 1);
curl_setopt ($ch, CURLOPT_POSTFIELDS, array(“post” => serialize($clientdata)));
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
$store = curl_exec ($ch);
echo $store;
curl_close ($ch);
exit;*/
// http://www.example.com/forum/ is the location where vbulletin is installed
VBulletin API for auto updating user details
1) Create a file with desired name (let it be vb_update.php) with the following code
require_once(‘class.forumops.php’);
$clientdata = unserialize($_POST[‘post’]);
foreach($clientdata as $key => $value)
{
$userdata[$key]=$value;
}
$forum = new ForumOps();
$errmsg = $forum->update_user($userdata);
if ($errmsg) echo $errmsg;
else echo “User Updated successfully.
n”;
NOTE :You can download the script using the url http://wp.me/p1aZaf-1d
2)Upload the file to the server the vBulletin installed
3)Paste the below given code , immediately after the code that update the user details .
$clientdata = array( ‘username’ =>$Username);
$clientdata[‘newusername’] = $newUsername;
$clientdata[‘password’] = $password;
$clientdata[’email’] = $email;
$url=”http://www.example.com/forum/vb_update.php”;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt ($ch, CURLOPT_POST, 1);
curl_setopt ($ch, CURLOPT_POSTFIELDS, array(“post” => serialize($clientdata)));
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
$store = curl_exec ($ch);
curl_close ($ch);
// http://www.example.com/forum/ is the location where vbulletin is installed