本文整理汇总了PHP中JUserHelper::genrandompassword方法的典型用法代码示例。如果您正苦于以下问题:PHP JUserHelper::genrandompassword方法的具体用法?PHP JUserHelper::genrandompassword怎么用?PHP JUserHelper::genrandompassword使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JUserHelper
的用法示例。
在下文中一共展示了JUserHelper::genrandompassword方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: generateCoupon
function generateCoupon(&$allresults, $i, &$user)
{
list($percent, $gift, $value, $name) = explode('|', $allresults[1][$i]);
$db =& JFactory::getDBO();
$key = JUserHelper::genrandompassword(5);
$value = str_replace(',', '.', $value);
$name = str_replace(array('[name]', '[subid]', '[email]', '[key]', '[value]'), array($user->name, $user->subid, $user->email, $key, $value), $name);
$db->setQuery('INSERT INTO ' . acymailing::table('vm_coupons', false) . '(`coupon_code`,`percent_or_total`,`coupon_type`,`coupon_value`) VALUES (' . $db->Quote($name) . ',' . $db->Quote($percent) . ',' . $db->Quote($gift) . ',' . $db->Quote($value) . ')');
$db->query();
return $name;
}
示例2: generateCoupon
function generateCoupon(&$allresults, $i, &$user)
{
list($minimum_order, $quota, $start, $end, $percent_amount, $flat_amount, $currency_id, $code, $product_id) = explode('|', $allresults[1][$i]);
jimport('joomla.user.helper');
$key = JUserHelper::genrandompassword(5);
if (!hikashop_level(1)) {
$minimum_order = 0;
$quota = '';
$product_id = '';
}
if ($percent_amount > 0) {
$value = $percent_amount;
} else {
$value = $flat_amount;
}
$value = str_replace(',', '.', $value);
if ($start) {
$start = hikashop_getTime($start);
}
if ($end) {
$end = hikashop_getTime($end);
}
$clean_name = strtoupper($user->name);
$space = strpos($clean_name, ' ');
if (!empty($space)) {
$clean_name = substr($clean_name, 0, $space);
}
$code = str_replace(array('[name]', '[clean_name]', '[subid]', '[email]', '[key]', '[flat]', '[percent]', '[value]', '[prodid]'), array($user->name, $clean_name, $user->subid, $user->email, $key, $flat_amount, $percent_amount, $value, $product_id), $code);
$this->db->setQuery('INSERT IGNORE INTO ' . acymailing_table('hikashop_discount', false) . '(
`discount_code`,
`discount_percent_amount`,
`discount_flat_amount`,
`discount_type`,
`discount_start`,
`discount_end`,
`discount_minimum_order`,
`discount_quota`,
`discount_currency_id`,
`discount_product_id`,
`discount_published`
) VALUES (' . $this->db->Quote($code) . ',' . $this->db->Quote($percent_amount) . ',' . $this->db->Quote($flat_amount) . ',\'coupon\',' . $this->db->Quote($start) . ',' . $this->db->Quote($end) . ',' . $this->db->Quote($minimum_order) . ',' . $this->db->Quote($quota) . ',' . $this->db->Quote(hikashop_getCurrency()) . ',' . $this->db->Quote($product_id) . ',
1)');
$this->db->query();
return $code;
}