Pear for 1.4, mage for 1.5. File downloaded into /downloader/.cache/community/
./pear download magento-community/Shipping_Agent
./mage download community Shipping_Agent
<?php | |
echo "Connecting to MySQL Server ... "; | |
mysql_connect( | |
"localhost", | |
"admin", | |
"pass123") | |
or die(mysql_error()); | |
echo "[OK]<br />"; |
<?php | |
$ipadrs = $_SERVER['REMOTE_ADDR']; | |
echo $ipadrs; | |
?> |
<?php | |
// Configuration | |
$myEmail = 'YOUR EMAIL HERE'; | |
$error = ''; | |
// To send HTML mail, the Content-type header must be set | |
$headers = 'MIME-Version: 1.0' . "\r\n"; | |
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; | |
// Additional headers |
<? | |
if (isset($_REQUEST["id"]) && ($_REQUEST["id"]<>"")) { | |
$data1=mysql_query("SELECT * FROM your_table WHERE id=".$_REQUEST["id"]); | |
$data=mysql_fetch_array($data1); | |
$from [email protected]; | |
$to = $data["email_field"]; | |
$user = $data["name_field"]; | |
$subject = "Enter your subject line here"; /*or if it comes from the table*/ $subject = $data["subject_field"]; | |
$header="From:" . $from . "\r\n " ."Reply-To:". $from ; | |
$body="Hello ". $user .",\n\nFirst line\n\nYour message goes here, \nbest regards,\nyour_name and such\n"; |
<?php | |
/** | |
* Determine the previous/next link and link to current category | |
*/ | |
$_ccat = $this->helper('catalog/data')->getCategory(); | |
$ppos = $_ccat->getProductsPosition(); | |
$current_pid = $this->helper('catalog/data')->getProduct()->getId(); | |
// build array from products positions | |
$plist = array(); | |
foreach ($ppos as $pid => $pos) { |
<?php | |
define('MAGENTO', realpath(dirname(__FILE__))); | |
ini_set('memory_limit', '32M'); | |
set_time_limit (0); | |
require_once MAGENTO . '/app/Mage.php'; | |
Mage::app(); | |
Mage::getModel('core/url_rewrite')->setIsSystem(0)->setOptions('RP')->setIdPath('Imported-Old-Website-URL-test1')->setTargetPath('alicia-suspender-skirt-32360')->setRequestPath('SHOPONLINE.aspx?Product=Alicia Skirt&Brand=Lascivious Test&PID=1975')->save(); | |
Mage::getModel('core/url_rewrite')->setIsSystem(0)->setOptions('RP')->setIdPath('Imported-Old-Website-URL-test2')->setTargetPath('alicia-suspender-skirt-32360')->setRequestPath('SHOPONLINE.aspx?Product=Alicia Skirt&Brand=Lascivious Test&PID=1975')->save(); |
find . -type f|while read f; do mv $f `echo $f |tr '[:upper:]' '[ :lower:]'`; done |
<?php print "<pre>" . print_r($var, true) . "</pre>"; ?> |
<?php | |
// app/roues.php | |
Route::group(array('before' => 'myfilter.filtername:value1,value2'), function() { | |
// Routing logic | |
}); | |
// app/filters.php | |
Route::filter('myfilter.filtername', 'MyCustomFilterClassNameFilter@filtermethodFilter'); |