登陸後頂部顯示:[您好,歡迎xxx登陸][會員中心][退出](question)

2.header.html代碼:javascript

[php] view plain copy php

<EMBED id=ZeroClipboardMovie_1 name=ZeroClipboardMovie_1 type=application/x-shockwave-flash align=middle pluginspage=http://www.macromedia.com/go/getflashplayer height=14 width=29 src=http://static.blog.csdn.net/scripts/ZeroClipboard/ZeroClipboard.swf wmode="transparent" flashvars="id=1&width=29&height=14" allowfullscreen="false" allowscriptaccess="always" bgcolor="#ffffff" quality="best" menu="false" loop="false">html

 print ?

5.在公共代碼放入iframe文件中後,最好在iframe外邊再加一個div來控制位置java


如: web

  1. <div class="log">  cookie

  2. 你好 (小偉),  app

  3. <a target="_blank" href="http://zhencms1.com/index.php?m=member&siteid=1">會員中心</a>  oop

  4. <a target="_top" href="http://zhencms1.com/index.php?m=member&c=index&a=logout&forward=http%3A%2F%2Fzhencms1.com%2Findex.php%3Fm%3Dcontent%26c%3Dindex%26a%3Dshow%26catid%3D18%26id%3D1&siteid=1">退出</a>  ui

  5. </div>  url

<div style="margin:0 auto;width:1000px;height:28px;">
<script type="text/javascript">document.write('<iframe src="{APP_PATH}index.php?m=member&c=index&a=mini&forward='+encodeURIComponent(location.href)+'&siteid={get_siteid()}" allowTransparency="true"  width="1000" height="28" frameborder="0" scrolling="no"></iframe>')</script>
</div>

<EMBED id=ZeroClipboardMovie_5 name=ZeroClipboardMovie_5 type=application/x-shockwave-flash align=middle pluginspage=http://www.macromedia.com/go/getflashplayer height=14 width=29 src=http://static.blog.csdn.net/scripts/ZeroClipboard/ZeroClipboard.swf wmode="transparent" flashvars="id=5&width=29&height=14" allowfullscreen="false" allowscriptaccess="always" bgcolor="#ffffff" quality="best" menu="false" loop="false">

 print ?

[php] view plain copy



  1. <div class="log">{if $_username}{L('hellow')} {get_nickname()}, <a href="{APP_PATH}index.php?m=member&siteid={$siteid}" target="_blank">{L('member_center')}</a> <a href="{APP_PATH}index.php?m=member&c=index&a=logout&forward={urlencode($_GET['forward'])}&siteid={$siteid}" target="_top">{L('logout')}</a>{else}<a href="{APP_PATH}index.php?m=member&c=index&a=register&siteid={$siteid}" target="_blank">{L('register')}</a> <span>|</span> <a href="{APP_PATH}index.php?m=member&c=index&a=login&forward={urlencode($_GET['forward'])}&siteid={$siteid}" target="_top">{L('login')}</a>  

  2. {/if}</div>  

[php] view plain copy

  1. /** 

  2.      * 獲取經過 set_cookie 設置的 cookie 變量  

  3.      * @param string $var 變量名 

  4.      * @param string $default 默認值  

  5.      * @return mixed 成功則返回cookie 值,不然返回 false 

  6.      */  

  7.     public static function get_cookie($var$default = '') {  

  8.         $var = pc_base::load_config('system','cookie_pre').$var;  

  9.         return isset($_COOKIE[$var]) ? sys_auth($_COOKIE[$var], 'DECODE') : $default;  

  10.     }  

<EMBED id=ZeroClipboardMovie_4 name=ZeroClipboardMovie_4 type=application/x-shockwave-flash align=middle pluginspage=http://www.macromedia.com/go/getflashplayer height=14 width=29 src=http://static.blog.csdn.net/scripts/ZeroClipboard/ZeroClipboard.swf wmode="transparent" flashvars="id=4&width=29&height=14" allowfullscreen="false" allowscriptaccess="always" bgcolor="#ffffff" quality="best" menu="false" loop="false">

 print ?

[php] view plain copy


4.找到phpcms/templates/member/mini.html文件:

  1. <script type="text/javascript">  

  2.     document.write('<iframe src="{APP_PATH}index.php?m=member&c=index&a=mini&forward='+encodeURIComponent(location.href)+'&siteid={get_siteid()}" allowTransparency="true"  width="500" height="24" frameborder="0" scrolling="no"></iframe>')  

  3. </script>  


3.找到phpcms/modules/member/index.php控制器中的mini方法

<EMBED id=ZeroClipboardMovie_3 name=ZeroClipboardMovie_3 type=application/x-shockwave-flash align=middle pluginspage=http://www.macromedia.com/go/getflashplayer height=14 width=29 src=http://static.blog.csdn.net/scripts/ZeroClipboard/ZeroClipboard.swf wmode="transparent" flashvars="id=3&width=29&height=14" allowfullscreen="false" allowscriptaccess="always" bgcolor="#ffffff" quality="best" menu="false" loop="false">

 print ?

  1. //mini登錄條  

  2.     public function mini() {  

  3.         //獲取經過 set_cookie 設置的 _username 變量  

  4.         $_username = param::get_cookie('_username');  

  5.         //獲取經過 set_cookie 設置的 _userid 變量  

  6.         $_userid = param::get_cookie('_userid');  

  7.         //當前站點  

  8.         $siteid = isset($_GET['siteid']) ? intval($_GET['siteid']) : '';  

  9.         //定義站點id常量  

  10.         if (!defined('SITEID')) {  

  11.            define('SITEID'$siteid);  

  12.         }  

  13.           

  14.         $snda_enable = pc_base::load_config('system''snda_enable');  

  15.         //頂部登陸信息:歡迎 xxx 登陸 ,會員中心、退出  

  16.         include template('member''mini');  

  17.     }  

[php] view plain copy

<EMBED id=ZeroClipboardMovie_2 name=ZeroClipboardMovie_2 type=application/x-shockwave-flash align=middle pluginspage=http://www.macromedia.com/go/getflashplayer height=14 width=29 src=http://static.blog.csdn.net/scripts/ZeroClipboard/ZeroClipboard.swf wmode="transparent" flashvars="id=2&width=29&height=14" allowfullscreen="false" allowscriptaccess="always" bgcolor="#ffffff" quality="best" menu="false" loop="false">

 print ?


備註:param::get_cookie('_username')所在位置:phpcms/libs/classes/param.class.php類庫文件【參數處理類】

相關文章
相關標籤/搜索