duanran3115 2013-05-08 12:46
浏览 84
已采纳

SignUp重定向到页面socialengine之后

Hi can someone tell me how to redirect only a type of Profile:

On my site i got two. Teacher and Students i want to redirect Teachers profiles types after Sign up to a custom page.

Thanks in advanced.

I got the a Widget can some help to customize it! thanks

http://www.integration4us.com/se-modsplugins/#aftersignupredirect

INDEX.TPL

  <?php
    /**
    * Integration4us
    *
 * @category   Application_Widget
 * @package    After SignUp to redirect to page
 * @copyright  Copyright 2009-2010 Integration4us
 * @license    http://www.integration4us.com/terms
 * @author     Jomar
 */


 $pageurl="http://se4.socialengine101.com/invite";



 $file = APPLICATION_PATH . '/application/settings/database.php';
 $options = include $file;
 $db = Zend_Db::factory($options['adapter'], $options['params']);
 $lnk = $db->getConnection();

 $user_id = $this->viewer()->getIdentity();

 $stmt = $db->query("select user_id from engine4_users where lastlogin_date is null and user_id='$user_id'");
 $arr = $stmt->fetch();
 if ( $arr[user_id] )
    {
    $db->query("update engine4_users set lastlogin_date=now() where user_id='$user_id'");
    header("Location: $pageurl");
    exit;
    }
?>

MANIFEST.PHP

<?php
/**
 * Integration4us
 *
 * @category   Application_Widget
 * @package    After SignUp Redirect Widget
 * @copyright  Copyright 2009-2010 Integration4us
 * @license    http://www.integration4us.com/terms
 * @author     Jomar
 */

return array(
  'package' => array(
    'type' => 'widget',
    'name' => 'aftersignupredirect',
    'version' => '4.0.0',
    'path' => 'application/widgets/aftersignupredirect',
    'repository' => '',
    'meta' => array(
      'title' => 'After SignUp Redirect',
      'description' => 'After SignUp Redirect Widget.',
      'author' => 'integration4us.com',
    ),
    'directories' => array(
      'application/widgets/aftersignupredirect',
    ),
  ),

  // Backwards compatibility
  'type' => 'widget',
  'name' => 'aftersignupredirect',
  'version' => '4.0.0',
  'title' => 'After SignUp Redirect',
  'description' => 'After SignUp Redirect Widget.',
  'category' => 'Widgets',
) ?>
  • 写回答

1条回答 默认 最新

  • duanniling0018 2013-05-08 12:59
    关注

    Can you create a new identifier in table? Like Col_name[0/1] 0 for student and 1 for teacher ?

    $stmt = $db->query("select user_id,col_name from engine4_users where lastlogin_date is null and 
    user_id='$user_id'");
    $arr = $stmt->fetch();
    if ( $arr[user_id] )
    {
        $val = $arr[col_name];
        $db->query("update engine4_users set lastlogin_date=now() where user_id='$user_id'");
        if($val==0)      
            header("Location: $pageurl"); // student page
        else
            header("Location: $page2_url"); // staff page
        exit;
    }
    

    If you can't create table...leave me comments :)

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 phython如何实现以下功能?查找同一用户名的消费金额合并—
  • ¥15 孟德尔随机化怎样画共定位分析图
  • ¥18 模拟电路问题解答有偿速度
  • ¥15 CST仿真别人的模型结果仿真结果S参数完全不对
  • ¥15 误删注册表文件致win10无法开启
  • ¥15 请问在阿里云服务器中怎么利用数据库制作网站
  • ¥60 ESP32怎么烧录自启动程序
  • ¥50 html2canvas超出滚动条不显示
  • ¥15 java业务性能问题求解(sql,业务设计相关)
  • ¥15 52810 尾椎c三个a 写蓝牙地址