資源描述:
《ecshop注冊送紅包插件安裝說明》由會員上傳分享,免費在線閱讀,更多相關(guān)內(nèi)容在行業(yè)資料-天天文庫。
1、頂億網(wǎng)Ecshop注冊送紅包插件安裝說明安裝過程:一、在ecshop后臺增加一種紅包類型二、后臺紅包列表里會增加一種紅包類型:三、記住注冊送紅包類型的編號,后面要用到四、修改includes/lib_common.php,在其文件最后?>前加一個函數(shù)functionsend_register_bonus($user_id,$bid){$user_info=$GLOBALS['db']->getRow("selectuser_name,emailfrom".$GLOBALS['ecs']->table('users'
2、)."whereuser_id='$user_id'");$bonus_type=$GLOBALS['db']->getRow("SELECT*FROM".$GLOBALS['ecs']->table('bonus_type')."WHEREtype_id='$bid'");if(!$bonus_type)returnfalse;$tpl=get_mail_template('send_bonus');if(!$tpl)returnfalse;$today=local_date($_CFG['date_format
3、']);/*發(fā)送郵件通知*/$GLOBALS['smarty']->assign('user_name',$user_info['user_name']);$GLOBALS['smarty']->assign('shop_name',$GLOBALS['_CFG']['shop_name']);$GLOBALS['smarty']->assign('send_date',$today);$GLOBALS['smarty']->assign('sent_date',$today);$GLOBALS['smarty']
4、->assign('count',1);$GLOBALS['smarty']->assign('money',price_format($bonus_type['type_money']));$content=$GLOBALS['smarty']->fetch('str:'.$tpl['template_content']);$time=time();$content=addslashes($content);$template_id=$GLOBALS['db']->getOne("SELECTtemplate_i
5、dFROM".$GLOBALS['ecs']->table('mail_templates')."WHEREtemplate_code='send_bonus'");$sql="INSERTINTO".$GLOBALS['ecs']->table('email_sendlist')."(email,template_id,email_content,pri,last_send)VALUES('$user_info[email]',$template_id,'$content',1,'$time')";$GLOBAL
6、S['db']->query($sql);/*向會員紅包表錄入數(shù)據(jù)*/$sql="INSERTINTO".$GLOBALS['ecs']->table('user_bonus')."(bonus_type_id,bonus_sn,user_id,used_time,order_id,emailed)"."VALUES('$bid',0,'$user_id',0,0,".BONUS_MAIL_SUCCEED.")";$GLOBALS['db']->query($sql);}如截圖所示五、最后修改lib_passpor
7、t.php的register函數(shù)增加:/***注冊送紅包**/send_register_bonus($_SESSION['user_id'],1);如圖所示開發(fā)人:php-lifeqq:40499756email:ydhcxh@126.com網(wǎng)址:http://ecshop.topit.cn功能說明見:一分鐘實現(xiàn)ecshop注冊送紅包