Simple JS function to detect positive integer
A simple and very useful js function to detect integer via Javascript
function isPositiveInteger(n) { return n >>> 0 === parseFloat(n); }
The Stonewall Inn

shark vs the universe
Misplaced Lens Cap

❣ Chile in a Photography ❣
trying on a metaphor

PR's Tumblrdome
Not today Justin
cherry valley forever

Andulka
Jules of Nature

ellievsbear
Keni

izzy's playlists!
Monterey Bay Aquarium

Kiana Khansmith
One Nice Bug Per Day
noise dept.
official daine visual archive
occasionally subtle
will byers stan first human second
seen from Ireland
seen from United States
seen from United States
seen from United States
seen from United States
seen from United States
seen from United States
seen from United States
seen from Chile
seen from United States

seen from United States

seen from United States
seen from United States
seen from Indonesia
seen from Uzbekistan

seen from Portugal

seen from Slovenia
seen from United States

seen from United States
seen from United States
@reginpv
Simple JS function to detect positive integer
A simple and very useful js function to detect integer via Javascript
function isPositiveInteger(n) { return n >>> 0 === parseFloat(n); }

Anya is live and ready to show you everything. Watch her strip, dance, and perform exclusive shows just for you. Interact in real-time and make your fantasies come true.
Free to watch • No registration required • HD streaming
Magento can not login to frontend - page just refreshes
this solution worked for me.
not sure though until when, ive encountered this problem too many times and I have different solution for each
so ill document this error here
app/mage.php
replace:Mage::register('original_include_path', get_include_path());
by the line below: Mage::register('original_include_path', '');
make sure clear cache and cookies
then check
UPDATE: 10-23-2013
Above solution did not fixed it!
However I found out that clearing cookies is fixing it temporarily.
UPDATE: 10-23-2013
After editing:
app/code/core/Mage/Customer/Model/Session.php
around line: 216
public function login($username, $password) { /** @var $customer Mage_Customer_Model_Customer */ $customer = Mage::getModel('customer/customer') ->setWebsiteId(Mage::app()->getStore()->getWebsiteId()); if ($customer->authenticate($username, $password)) { $this->setCustomerAsLoggedIn($customer); $this->renewSession(); return true; } return false; }
Comment out: $this->renewSession();
so the code will be:
public function login($username, $password) { /** @var $customer Mage_Customer_Model_Customer */ $customer = Mage::getModel('customer/customer') ->setWebsiteId(Mage::app()->getStore()->getWebsiteId()); if ($customer->authenticate($username, $password)) { $this->setCustomerAsLoggedIn($customer); //$this->renewSession(); return true; } return false; }
Remember that we did not put any code but just commented out renewSession line, together with this, on my Magento admin
my cookie domain is: ".yourdomain.com" (notice the dot!)
and the cookie path is: "/"
its been 2 days now and had not encounter problems logging in on magento front-end
ill continue to monitor and let's see
UPDATE: 10-25-2013
I guess my update on Ocober 23, 2013, solved it.
never had a problem ever since! hooray! :)
UPDATE 11-1-2013
Apologies for the solution I provided on my blog: "Magento customers login problem - page on loop, with no error message displayed" app/mage.php replace:Mage::register(‘original_include_path’, get_include_path()); by the line below: Mage::register(‘original_include_path’, ”); While this fixed the bug, it affected the "Magento Connect" throwing error "Maged_session not found", you'll be unable to update or re-install. If you encounter this, please revert changes made on app/mage.php file, and go to: app/code/core/Mage/Customer/Model/Session.php Look for the method: "public function login($username, $password)" and comment out line: $this->renewSession(); by doing this: "//$this->renewSession();"
Show login and logout button for Magento
Code to show login and logout link
<?php if (! Mage::getSingleton('customer/session')->isLoggedIn()): ?> <a href="<?php echo Mage::helper('customer')->getLoginUrl(); ?>"><?php echo $this->__('Log In') ?></a> <?php else: ?> <a href="<?php echo Mage::helper('customer')->getLogoutUrl(); ?>"><?php echo $this->__('Log Out') ?></a> <?php endif; ?>
Adding Magento product in a category via script
Mage::getSingleton('catalog/category_api')->removeProduct($category->getId(),$product->getId());
and
Mage::getSingleton('catalog/category_api')->assignProduct($category->getId(),$product->getId());
How to add a layout option in magento admin
edit: app/code/core/Mage/Page/etc/config.xml
and add your new template inside <layout> tags :)

Anya is live and ready to show you everything. Watch her strip, dance, and perform exclusive shows just for you. Interact in real-time and make your fantasies come true.
Free to watch • No registration required • HD streaming
Display magento newsletter on CMS or static blocks
inset code:
{{block type="newsletter/subscribe" name="left.newsletter" template="newsletter/subscribe.phtml"}}
Servers are down!
Bluehost, Hostgator, Hostmonster data centers are down! Not so 100% uptime as promised!
Backslash in Tumblr
Can't display backslash? Nothing on ASCII? use \\\\ to display a \\ on your postings :)
Force WWW on URLs site-wide via .HTACCESS
on you .htaccess file
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !^www\\.WEBSITE\\.com [NC] RewriteRule ^(.*) http://www.WEBSITE.com/$1 [L,R=301]
Replace WEBSITE with your own domain
This assumes you have Apache working and has .htaccess file on you root.
If you do not have .htaccess file create one with the ff code above.
How to add a specific category list in Magento CMS page?
on your page information->content input below:
{{block type="catalog/product_list" category_id="CATEGORY_ID" template="catalog/product/list.phtml"}}

Anya is live and ready to show you everything. Watch her strip, dance, and perform exclusive shows just for you. Interact in real-time and make your fantasies come true.
Free to watch • No registration required • HD streaming
Eliminating those funny diagonal with question marks characters on you web pages via codeigniter
First of all, this post can rank at the top on longest title on tumblr post LOL.
anyway those funny character are called ascii characters, these are symbolic characters that your webpage or your browser failed to display.
To do it use codeigniter's ascii_to_entities() function.
thats it.
sample:
ascii_to_entities($this_is_my_string_with_funny_characters);
Javascript functions for setting COOKIE, reading COOKIE and deleting COOKIE
Waiver: I did not create this function, I found it on web and I just like to record and share because it works AWESOME!
function setCookie(name,value,days) { if (days) { var date = new Date(); date.setTime(date.getTime()+(days*24*60*60*1000)); var expires = "; expires="+date.toGMTString(); } else var expires = ""; document.cookie = name+"="+value+expires+"; path=/"; } function getCookie(name) { var nameEQ = name + "="; var ca = document.cookie.split(';'); for(var i=0;i < ca.length;i++) { var c = ca[i]; while (c.charAt(0)==' ') c = c.substring(1,c.length); if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length); } return null; } function deleteCookie(name) { setCookie(name,"",-1); }
Display dialog box / Modal box on page load via jquery
This assumes Jquery is already embed
$(document).ready(function(){
$j("#reg").dialog({modal: true, autoOpen : true, height: 360, width: 450,});
});
Hello Tumblr!