Question Không cho khách thấy nội dung Chatbox

Thảo luận trong 'Add-on Quesions' bắt đầu bởi littleken, 23/7/12.

1votes
5/5, 1 vote

  1. littleken

    littleken New Member

    Bài viết:
    12
    Likes :
    2
    Hiện tại mình đang dùng chatbox Chang, mình muốn hỏi cái này:
    - Giờ mình muốn khi khách vào xem 4rum vẫn thấy được khung chatbox, nhưng phần nội dung sẽ hiển thị là "bạn phải đăng nhập để thấy được nội dung".

    Lưu ý: khách vẫn thấy dc khung chatbox chứ không phải cấm khách thấy chatbox nhé.

    Vậy mình phải sửa code trong fcb_shoutbox như thế nào.
    Thanks
     
    Đang tải...
  2. Xavier

    Xavier Well-Known Member

    Bài viết:
    1,414
    Likes :
    522
    vứt đoạn code lên xem nào :|
     
  3. littleken

    littleken New Member

    Bài viết:
    12
    Likes :
    2
    Giúp mình nhé, nhớ là ko thấy dc nội dung chat thôi chứ khung chatbox vẫn thấy, thanks
    PHP:
    <xen:set var="$chatbox.title"></xen:set>
    <
    xen:set var="$chatbox.link"></xen:set>
    <
    xen:set var="$chatbox.smilies">fcb_smilies.txt</xen:set>
    <
    xen:set var="$chatbox.random">10</xen:set>
    <
    xen:set var="$chatbox.height">300</xen:set>
    <
    xen:set var="$chatbox.key"></xen:set>
     
    <
    style type="text/css">
    .
    fcb_chatbox{padding:0px 0px;}
    .
    fcb_chatbox div{margin:0px 0px 5px 0px;}
    .
    fcb_chatbox iframe{
        
    width:100%;
        
    border:0px;
        
    padding:0px;
        
    height:{xen:raw '$chatbox.height'}px;
        
    background-color#F5FAEA;}
    .fcb_chatbox .txtarea{min-width:90%;}
    .
    fcb_chatbox form input{margin-left:5px;}
    </
    style>
     
    <
    script src="http://prototypejs.org/javascripts/prototype.js" type="text/javascript"></script>
    <script language="JavaScript" type="text/javascript">
    var chatboxlink = '{xen:raw '$chatbox.link'}';
    var chatboxsmilies = '{xen:raw '$chatbox.smilies'}';
    var chatboxrandom = '{xen:raw '$chatbox.random'}';
    var textstyle=document.getElementById('hmess');
    var chatboxkey='{xen:calc 'md5({$visitor.user_id}.{xen:raw '$chatbox.key'}.{$visitor.user_group_id}.md5({$visitor.username}.{xen:raw '$chatbox.key'}))'}';
    var huid='{$visitor.user_id}';
    var hgroupid='{$visitor.user_group_id}';
    var hgroupip='{$_SERVER.REMOTE_ADDR}';
    var huser='{$visitor.username}';
    if(fcb_getCookie('fcb_b_userid{$visitor.user_id}').length>0)
    {document.fcb_form.hbold.value=fcb_getCookie('fcb_b_userid{$visitor.user_id}');}
    if(fcb_getCookie('fcb_i_userid{$visitor.user_id}').length>0)
    {document.fcb_form.hitalic.value=fcb_getCookie('fcb_i_userid{$visitor.user_id}');}
    if(fcb_getCookie('fcb_u_userid{$visitor.user_id}').length>0)
    {document.fcb_form.hunderline.value=fcb_getCookie('fcb_u_userid{$visitor.user_id}');}
    if(fcb_getCookie('fcb_font_userid{$visitor.user_id}').length>0)
    {document.fcb_form.hfont.value=fcb_getCookie('fcb_font_userid{$visitor.user_id}');}
    if(fcb_getCookie('fcb_color_userid{$visitor.user_id}').length>0)
    {document.fcb_form.hcolor.value=fcb_getCookie('fcb_color_userid{$visitor.user_id}');}
    fcb_upstyle_cookie();function fcb_upstyle_cookie()
    {if(document.fcb_form.hbold.value=='B*')
    {textstyle.style.fontWeight='bold';}
    else
    {textstyle.style.fontWeight='normal';}
    if(document.fcb_form.hitalic.value=='I*')
    {textstyle.style.fontStyle='italic';}
    else
    {textstyle.style.fontStyle='normal';}
    if(document.fcb_form.hunderline.value=='U*')
    {textstyle.style.textDecoration='underline';}
    else
    {textstyle.style.textDecoration='none';}
    textstyle.style.fontFamily=document.fcb_form.hfont.value;textstyle.style.color=document.fcb_form.hcolor.value;}
    function fcb_upstyle(element)
    {if(element=='b')
    {if(document.fcb_form.hbold.value=='B')
    {document.fcb_form.hbold.value='B*';textstyle.style.fontWeight='bold';}
    else
    {document.fcb_form.hbold.value='B';textstyle.style.fontWeight='normal';}}
    else if(element=='i')
    {if(document.fcb_form.hitalic.value=='I')
    {document.fcb_form.hitalic.value='I*';textstyle.style.fontStyle='italic';}
    else
    {document.fcb_form.hitalic.value='I';textstyle.style.fontStyle='normal';}}
    else if(element=='u')
    {if(document.fcb_form.hunderline.value=='U')
    {document.fcb_form.hunderline.value='U*';textstyle.style.textDecoration='underline';}
    else
    {document.fcb_form.hunderline.value='U';textstyle.style.textDecoration='none';}}
    else if(element=='font')
    {textstyle.style.fontFamily=document.fcb_form.hfont.value;}
    else if(element=='color')
    {textstyle.style.color=document.fcb_form.hcolor.value;}
    fcb_setCookie('fcb_b_userid{$visitor.user_id}',document.fcb_form.hbold.value);fcb_setCookie('fcb_i_userid{$visitor.user_id}',document.fcb_form.hitalic.value);fcb_setCookie('fcb_u_userid{$visitor.user_id}',document.fcb_form.hunderline.value);fcb_setCookie('fcb_font_userid{$visitor.user_id}',document.fcb_form.hfont.value);fcb_setCookie('fcb_color_userid{$visitor.user_id}',document.fcb_form.hcolor.value);}
    function fcb_setCookie(c_name,value)
    {exdate=new Date();exdate.setDate(exdate.getDate()+365);document.cookie=c_name+"="+escape(value)+";expires="+exdate.toGMTString()+"path=/";}
    function fcb_getCookie(c_name)
    {if(document.cookie.length>0)
    {c_start=document.cookie.indexOf(c_name+"=");if(c_start!=-1)
    {c_start=c_start+c_name.length+1;c_end=document.cookie.indexOf(";",c_start);if(c_end==-1)c_end=document.cookie.length;return unescape(document.cookie.substring(c_start,c_end));}
    else{return"";}}}
    function fcb_postshout()
    {hmess1=document.fcb_form.hmess.value;var hmess2=hmess1.replace("[img]","[img]");var hmess=hmess2.replace("http","http");hcolor=document.fcb_form.hcolor.value;hfont=document.fcb_form.hfont.value;hbold=document.fcb_form.hbold.value;hitalic=document.fcb_form.hitalic.value;hunderline=document.fcb_form.hunderline.value;document.fcb_form.hmess.value='';if(hmess=='')
    {alert('Xin hãy nhập nội dung!');}
    else
    {fcb_frame.location=chatboxlink+'/?do=postshout&key='+chatboxkey+'&userid='+huid+'&groupid='+hgroupid+'&username='+huser+'&message='+encodeURIComponent(hmess)+'&color='+hcolor+'&font='+hfont+'&bold='+hbold+'&italic='+hitalic+'&underline='+hunderline;}}
    function archivepage()
    {window.open(chatboxlink+"/archive.php","fcbarchive","location=no,scrollbars=yes,width=640,height=480");}
    function fcb_refresh()
    {fcb_frame.location=chatboxlink;}
    function smiliepopup()
    {window.open("smilies.php?file="+chatboxlink+"/"+chatboxsmilies,"fcballsmilies","location=no,scrollbars=yes,width=500,height=500");}
    function addsmilie(code)
    {document.fcb_form.hmess.value = document.fcb_form.hmess.value + code;}
    function smshow(request)
    {if (request.readyState == 4 && request.status == 200)
    {document.getElementById('fcb_smiliebox').innerHTML = request.responseText;}}
    function fcb_showsmilies()
    {document.getElementById('fcb_smiliebox').innerHTML = 'Đang tải Smilies....';
    new Ajax.Request('smilies.php?do=fcb_randomsmilies&file='+chatboxlink+'/'+chatboxsmilies+'&random='+chatboxrandom, {method: 'GET', onSuccess: function(request) {smshow(request);}});}
    function fcb_showsmiliebox()
    {if(document.getElementById('fcb_smilieboxmain').style.display=='none')
    {document.getElementById('fcb_smilieboxmain').style.display='inline';fcb_showsmilies();}
    else
    {document.getElementById('fcb_smilieboxmain').style.display='none';}}
    function fcb_hideshowsmiliebox()
    {document.getElementById('fcb_smilieboxmain').style.display='none';}
    </script>
     
    <fieldset>
    <ol class="nodeList sectionMain" id="forums">
    <div class="nodeInfo categoryNodeInfo categoryStrip">
    <div class="categoryText"><h3 class="nodeTitle">
    {xen:raw '$chatbox.title'}</h3>       
    </div></div>
    <div class="fcb_chatbox" >
    <div id="fcb_smilieboxmain" style="display: none;">
        <div align="center">
            <input type="button" class="button" value="Smilies khác" onclick="fcb_showsmilies();">
            <input type="button" class="button" value="Tất cả Smilies" onclick="smiliepopup();">
            <input type="button" class="button" value="Đóng" onclick="fcb_hideshowsmiliebox();">
        </div>
        <div id="fcb_smiliebox" align="center" style="margin-top: 3px; margin-bottom: 3px;"></div>
    </div>
    <form name="fcb_form" method="post" action="javascript:fcb_postshout();">
    <div style='display:block'><input  id="hmess" type="text"class="txtarea" name="hmess">
    <input type="submit" class="button" value="Gửi"></div>
    <div style='display:block'>
        <input style="font-weight: bold;" type="button" name="hbold" value="B" class="button" onclick="fcb_upstyle('b');">
        <input style="font-style: italic;" type="button" name="hitalic" value="I" class="button" onclick="fcb_upstyle('i');">
        <input style="text-decoration: underline;" type="button" name="hunderline" value="U" class="button" onclick="fcb_upstyle('u');">
        <select onchange="fcb_upstyle('font');" name="hfont">
        <option value="">Chọn Font</option>
        <option style='font: Arial;' value='Arial'>Arial</option><option style='font: Arial Black;' value='Arial Black'>Arial Black</option><option style='font: Arial Narrow;' value='Arial Narrow'>Arial Narrow</option><option style='font: Book Antiqua;' value='Book Antiqua'>Book Antiqua</option><option style='font: Century Gothic;' value='Century Gothic'>Century Gothic</option><option style='font: Comic Sans MS;' value='Comic Sans MS'>Comic Sans MS</option><option style='font: Courier New;' value='Courier New'>Courier New</option><option style='font: Fixedsys;' value='Fixedsys'>Fixedsys</option><option style='font: Franklin Gothic Medium;' value='Franklin Gothic Medium'>Franklin Gothic Medium</option><option style='font: Garamond;' value='Garamond'>Garamond</option><option style='font: Georgia;' value='Georgia'>Georgia</option><option style='font: Impact;' value='Impact'>Impact</option><option style='font: Lucida Console;' value='Lucida Console'>Lucida Console</option><option style='font: Lucida Sans Unicode;' value='Lucida Sans Unicode'>Lucida Sans Unicode</option><option style='font: Microsoft Sans Serif;' value='Microsoft Sans Serif'>Microsoft Sans Serif</option><option style='font: Palatino Linotype;' value='Palatino Linotype'>Palatino Linotype</option><option style='font: System;' value='System'>System</option><option style='font: Tahoma;' value='Tahoma'>Tahoma</option><option style='font: Times New Roman;' value='Times New Roman'>Times New Roman</option><option style='font: Trebuchet MS;' value='Trebuchet MS'>Trebuchet MS</option><option style='font: Verdana;' value='Verdana'>Verdana</option>
        </select>
        <select onchange="fcb_upstyle('color');" name="hcolor">
        <option value="">Chọn màu</option>
        <option style='background: Gold;' value='Gold'>Gold</option><option style='background: Khaki;' value='Khaki'>Khaki</option><option style='background: Orange;' value='Orange'>Orange</option><option style='background: LightPink;' value='LightPink'>LightPink</option><option style='background: Salmon;' value='Salmon'>Salmon</option><option style='background: Tomato;' value='Tomato'>Tomato</option><option style='background: Red;' value='Red'>Red</option><option style='background: Brown;' value='Brown'>Brown</option><option style='background: Maroon;' value='Maroon'>Maroon</option><option style='background: DarkGreen;' value='DarkGreen'>DarkGreen</option><option style='background: DarkCyan;' value='DarkCyan'>DarkCyan</option><option style='background: LightSeaGreen;' value='LightSeaGreen'>LightSeaGreen</option><option style='background: LawnGreen;' value='LawnGreen'>LawnGreen</option><option style='background: MediumSeaGreen;' value='MediumSeaGreen'>MediumSeaGreen</option><option style='background: BlueViolet;' value='BlueViolet'>BlueViolet</option><option style='background: Cyan;' value='Cyan'>Cyan</option><option style='background: Blue;' value='Blue'>Blue</option><option style='background: DodgerBlue;' value='DodgerBlue'>DodgerBlue</option><option style='background: LightSkyBlue;' value='LightSkyBlue'>LightSkyBlue</option><option style='background: White;' value='White'>White</option><option style='background: DimGray;' value='DimGray'>DimGray</option><option style='background: DarkGray;' value='DarkGray'>DarkGray</option><option style='background: Black;' value='Black'>Black</option>
        </select>
    <input type="button" value="Smile" class="button" onclick="fcb_showsmiliebox();">
    <input type="button" value="Làm mới" class="button" onclick="fcb_refresh();">
    <input type="button" value="Lưu trữ" class="button" onclick="archivepage();">
    </div>
    </form>
    <iframe name="fcb_frame" src="{xen:raw '$chatbox.link'}" frameborder="0" class="framesb"></iframe>
    </div>
    </ol>
    </fieldset>
     
  4. littleken

    littleken New Member

    Bài viết:
    12
    Likes :
    2
    Giúp mình nhé :">
     
  5. maianhden

    maianhden Active Member

    Bài viết:
    244
    Likes :
    115
    Chẳng liên quan gì cái template kia cả, ông kia chỉ có phán bừa.
     
  6. Kiên Phạm Trung

    Kiên Phạm Trung New Member

    Bài viết:
    63
    Likes :
    19
    <xen:if is="{$visitor.user_id}">
    <iframe name="fcb_frame" src="{xen:raw '$chatbox.link'}" frameborder="0" class="framesb"></iframe>


    <xen:else /> Nội dung thông báo


    </xen:if>
     
    littleken thích bài này.
  7. littleken

    littleken New Member

    Bài viết:
    12
    Likes :
    2
    Vâng chính nó, thanks :">
     
comments powered by Disqus

Chia sẻ trang này

Đang tải...