1. Мы продолжаем публиковать интересные статьи на тему SocialEngine 4. Одна из статей посвящена правильному выбору сервера для вашей социальной сети, а другая содержит советы по увеличению производительности платформы. Также мы добавили большую статью о пользовательских уровнях. Ознакомиться со статьями вы можете в разделе Вопросы и Ответы SocialEngine 4.
  2. Вам кажется, что ваша версия SocialEngine 4, работает медленно?

    Голосуйте. Пишите свою версию системы, железо на чем работает и количество пользователей. Будем увеличивать производительность :-) Подробнее

  3. В связи с участившимися случаями попыток продажи пользователями форума различных "сборок" коммерческих социальных платформ, обычно основанных на SocialEngine 3, вводится новое правило для форума. Запрещается создание тем или размещение в уже созданных предложений о продаже или размещение ссылок на сайты, где происходит продажа "сборок". Пользователи, которые продолжат свою коммерческую деятельность в данном направлении, будут заблокированы. Подробнее.

Better Newsfeed by SDL

Discussion dans 'ЦЕХ' créé par Prado, 30 Janvier 2010.

  1. Prado Auteur de la discussion Challenge Everything


    Оффлайн
    • Admin
    Messages:
    3 191
    J'aime reçus:
    786
    Версия phpFox:
    3.0.0
    Better Newsfeed
    by Samanalee Design Labs

    Комментарии для ленты ленты обновлений.

    Live Demo - OpenDNS (Test/Demo Account NOT Allowed)

    Step 1 - Open "include/js/newsfeed_advanced.js" and Find this

    Code:
    function SEP_NewsfeedAdvanced_toggle_box(action_id, display) {
    		if(display == 'preview') {
    			$('SEP_NewsfeedAdvanced_Box_Final_'+action_id).sep_nfa_hide();	
    			if(SEP_NewsfeedAdvanced_AutoGrow_Instance) {
    				$('SEP_NewsfeedAdvanced_Textarea_'+action_id).setStyle('height', SEP_NewsfeedAdvanced_AutoGrow_Instance.textarea_old_height);		
    			}
    			$('SEP_NewsfeedAdvanced_Box_Preview_'+action_id).sep_nfa_show();			
    		}
    		else {
    			$('SEP_NewsfeedAdvanced_Box_Preview_'+action_id).sep_nfa_hide();
    			$('SEP_NewsfeedAdvanced_Box_Final_'+action_id).sep_nfa_show();	
    			$('SEP_NewsfeedAdvanced_Textarea_'+action_id).focus();
    		}
    }
    Paste this Code After it

    Code:
    function SEP_NewsfeedAdvanced_totally_hide_box(action_id) {
    			$('SEP_NewsfeedAdvanced_Box_Final_'+action_id).sep_nfa_hide();
    			$('SEP_NewsfeedAdvanced_Box_Preview_'+action_id).sep_nfa_show();
    }
    Step 2 - Open "templates/user_newsfeed_advanced.tpl" and Find this

    Code:
    	{if $user->user_exists}
    		{* INSERT NEW COMMENTS BELOW THIS DIV *}
    		<div id="ajax_inject_new_post_{$actions[actions_loop].action_id}"></div>
    		
    		{* DISPLAY COMMENT FORM PREVIEW *}
    		<div id="SEP_NewsfeedAdvanced_Box_Preview_{$actions[actions_loop].action_id}" style="">
    			{if $SEP_NewsfeedAdvancedO->number_of_comments > 0}
    			<div class="SEP_NewsfeedAdvanced_Box">
    				<textarea class="SEP_NewsfeedAdvanced_Textarea_Preview" name="text" onClick="SEP_NewsfeedAdvanced_toggle_box({$actions[actions_loop].action_id}, null);" rows="3">{lang_print id=18900017}</textarea>
    			</div>
    			{/if}
    		</div>
    Replace it with This

    Code:
    	{if $user->user_exists}
    
    		{* INSERT NEW COMMENTS BELOW THIS DIV *}
    
    		<div id="ajax_inject_new_post_{$actions[actions_loop].action_id}"></div>
    
    		
    
    		{* DISPLAY COMMENT FORM PREVIEW *}
    
    		<div id="SEP_NewsfeedAdvanced_Box_Preview_{$actions[actions_loop].action_id}" style="">
    
                        {if $SEP_NewsfeedAdvancedO->number_of_comments > 0}
    
    			<div class="SEP_NewsfeedAdvanced_Box">
    
    				&nbsp;<a href="javascript:void(0);" onClick="SEP_NewsfeedAdvanced_toggle_box({$actions[actions_loop].action_id}, null);">Write Something...</a>
    
    			</div>
    
                         {/if}
    
    		</div>
    Now find this in Same File

    Code:
    		{* DISPLAY COMMENT FORM *}
    		<div id="SEP_NewsfeedAdvanced_Box_Final_{$actions[actions_loop].action_id}" style="display:none">
    		<div class="SEP_NewsfeedAdvanced_Box">
    			<table border="0" cellspacing="0" cellpadding="0" width="100%">
    			<tr>
    				<td valign="top" align="left" width="{$SEP_NewsfeedAdvancedO->thumb_width}">
    					<a href='{$url->url_create("profile", $user->user_info.user_username)}'><img src='{$user->user_photo("./images/nophoto.gif", TRUE)}' class='photo' width='{$SEP_NewsfeedAdvancedO->thumb_width}' border='0'></a>
    				</td>
    				<td valign="top" align="left" style="padding-left:5px">
    					<div class="SEP_NewsfeedAdvanced_Box_Header">
    					<a href="{$url->url_create("profile", $user->user_info.user_username)}">{$user->user_displayname_short}</a><span class="SEP_NewsfeedAdvanced_Salut">{lang_print id=18900018}
    					</div>
    		
    					<form id="comment_post_form_{$actions[actions_loop].action_id}" name="comment_post_form_{$actions[actions_loop].action_id}" onSubmit="if(!SEP_NewsfeedAdvanced_Check_MaxLength('SEP_NewsfeedAdvanced_Textarea_{$actions[actions_loop].action_id}', {$SEP_NewsfeedAdvancedO->text_maxlength})){literal}{{/literal}return false;{literal}}{/literal}; SEP_NewsfeedAdvanced_post({$actions[actions_loop].action_id}, 3); SEP_NewsfeedAdvanced_toggle_box({$actions[actions_loop].action_id}, 'preview');return false;">
    	 				<textarea class="SEP_NewsfeedAdvanced_Textarea" name="text" id="SEP_NewsfeedAdvanced_Textarea_{$actions[actions_loop].action_id}" onFocus="SEP_NewsfeedAdvanced_AutoGrow_Instance = new AutoGrow($('SEP_NewsfeedAdvanced_Textarea_{$actions[actions_loop].action_id}'));" onBlur="SEP_NewsfeedAdvanced_AutoGrow_Instance.stop();"></textarea>
    	 				<br>
    	    			<input type="submit" value="{lang_print id=18900019}" class="button" class="SEP_NewsfeedAdvanced_Button">
    	    			</form>
    		
    				</td>
    			</tr>
    			</table>
    		</div>
    		</div>
    	{/if} 
    Replace it with This

    Code:
    		{* DISPLAY COMMENT FORM *}
    
    		<div id="SEP_NewsfeedAdvanced_Box_Final_{$actions[actions_loop].action_id}" style="display:none">
    
    		<div class="SEP_NewsfeedAdvanced_Box">
    
    			<table border="0" cellspacing="0" cellpadding="0" width="100%">
    
    			<tr>
    
    				<td valign="top" align="left" width="{$SEP_NewsfeedAdvancedO->thumb_width}">
    
    					<a href='{$url->url_create("profile", $user->user_info.user_username)}'><img src='{$user->user_photo("./images/nophoto.gif", TRUE)}' class='photo' width='{$SEP_NewsfeedAdvancedO->thumb_width}' border='0'></a>
    
    				</td>
    
    				<td valign="top" align="left" style="padding-left:5px">
    
    					<div class="SEP_NewsfeedAdvanced_Box_Header">
    
    					<a href="{$url->url_create("profile", $user->user_info.user_username)}">{$user->user_displayname_short}</a><span class="SEP_NewsfeedAdvanced_Salut">{lang_print id=18900018}
    
    					</div>
    
    
    
    					<form id="comment_post_form_{$actions[actions_loop].action_id}" name="comment_post_form_{$actions[actions_loop].action_id}" onSubmit="if(!SEP_NewsfeedAdvanced_Check_MaxLength('SEP_NewsfeedAdvanced_Textarea_{$actions[actions_loop].action_id}', {$SEP_NewsfeedAdvancedO->text_maxlength})){literal}{{/literal}return false;{literal}}{/literal}; SEP_NewsfeedAdvanced_post({$actions[actions_loop].action_id}, 3); SEP_NewsfeedAdvanced_toggle_box({$actions[actions_loop].action_id}, 'preview');return false;">
    
    	 				<textarea class="SEP_NewsfeedAdvanced_Textarea" name="text" id="SEP_NewsfeedAdvanced_Textarea_{$actions[actions_loop].action_id}" onFocus="SEP_NewsfeedAdvanced_AutoGrow_Instance = new AutoGrow($('SEP_NewsfeedAdvanced_Textarea_{$actions[actions_loop].action_id}'));" onBlur="SEP_NewsfeedAdvanced_AutoGrow_Instance.stop();"></textarea>
    
    	 				<br><br>
    
    	    			<input type="submit" value="Comment" class="button" class="SEP_NewsfeedAdvanced_Button"> <input type="reset" value="Reset" class="button" class="SEP_NewsfeedAdvanced_Button"> <input type="button" value="Cancel" class="button" class="SEP_NewsfeedAdvanced_Button" onClick="SEP_NewsfeedAdvanced_totally_hide_box({$actions[actions_loop].action_id});">
    		                </form><br>
    			    </td>
    			</tr>
    			</table>
    		</div>
    		</div>
    	{/if} 
    Пробуем :)

    ---------- Добавлено в 23:14 ---------- Предыдущее сообщение было написано в 23:12 ----------

    Прошлое выложите на сайт, а то у меня трафика нет :( вообще --------
  2. Gooos абырвалГ


    Оффлайн
    • Admin
    Messages:
    2 435
    J'aime reçus:
    645
    Версия SocialEngine:
    3.20
    Должно быть что-то типа этого?

    Fichiers attachés:

    • awa.jpg
      awa.jpg
      Taille de fichier:
      49.5 KB
      Affichages:
      15
  3. aj7r User


    Оффлайн
    Messages:
    128
    J'aime reçus:
    39
    Версия SocialEngine:
    3.20
    через пол часика попробую ;)

    ---------- Добавлено в 19:22 ---------- Предыдущее сообщение было написано в 19:05 ----------

    чот я потерялся у меня такова нету :(
  4. Gooos абырвалГ


    Оффлайн
    • Admin
    Messages:
    2 435
    J'aime reçus:
    645
    Версия SocialEngine:
    3.20
    newsfeed_advanced.js

    SE 3.18

    PHP:
    Element.implement({
        
    sep_nfa_show: function() {
            
    this.setStyle('display','');
        },
        
    sep_nfa_hide: function() {
            
    this.setStyle('display','none');
        },
        
    sep_nfa_visible: function() {
            if(
    this.getStyle('display') == 'none') {
                return 
    false;    
            }
            else {
                return 
    true;
            }    
        },
        
    sep_nfa_toggle: function() {
            if(
    this.getStyle('display') == 'none') {
                
    this.sep_nfa_show();
            }
            else {
                
    this.sep_nfa_hide();
            }                
        },
        
    sep_nfa_update: function(html) {
            
    this.innerHTML html;
        }
    });        
       
    function 
    SEP_NewsfeedAdvanced_post(action_idtype) {
        
    data_string '';
        if(
    type == 3) {
            
    data_string = $('comment_post_form_'+action_id).toQueryString();
        }
             
        
    myreq2 = new Request({
            
    method'post',
            
    url'./user_newsfeed_advanced_ajax.php',
            
    data'_ajaxReq=1&task=post&type='+type+'&action_id='+action_id+'&' data_string,
            
    onSuccess: function(html){ $('ajax_inject_new_post_'+action_id).clone().injectBefore('ajax_inject_new_post_'+action_id).sep_nfa_update(html.replace(/\\n/g'<br>')); $('comment_post_form_'+action_id).reset(); if(type == || type == 2) {$('likes_buttons_'+action_id).sep_nfa_hide();} },
            
    onFailure: function() {alert('Could not save your comment! Please try again!');}
        }).
    send();                    

    }

    function 
    SEP_NewsfeedAdvanced_show_edit_form(id) {
        if($(
    'SEP_NewsfeedAdvanced_Edit_'+id).sep_nfa_visible()) {
            
    SEP_NewsfeedAdvanced_hide_edit_form(id);
        }
        else {
            $(
    'SEP_NewsfeedAdvanced_Text_'+id).sep_nfa_hide();
            $(
    'SEP_NewsfeedAdvanced_Edit_'+id).sep_nfa_show();
            $(
    'SEP_NewsfeedAdvanced_Textarea_Edit_'+id).focus();
        }
    }

    function 
    SEP_NewsfeedAdvanced_show_comment_form(id) {
        if($(
    'SEP_NewsfeedAdvanced_Comment_'+id).sep_nfa_visible()) {
            
    SEP_NewsfeedAdvanced_hide_comment_form(id);
        }
        else {
            $(
    'SEP_NewsfeedAdvanced_Comment_Text_'+id).sep_nfa_hide();
            $(
    'SEP_NewsfeedAdvanced_Comment_'+id).sep_nfa_show();
            $(
    'SEP_NewsfeedAdvanced_Textarea_'+id).focus();
        }
    }

    function 
    SEP_NewsfeedAdvanced_hide_edit_form(id) {
        $(
    'SEP_NewsfeedAdvanced_Edit_'+id).sep_nfa_hide();
        $(
    'SEP_NewsfeedAdvanced_Text_'+id).sep_nfa_show();    
    }

    function 
    SEP_NewsfeedAdvanced_hide_comment_form(id) {
        $(
    'SEP_NewsfeedAdvanced_Comment_'+id).sep_nfa_hide();
        $(
    'SEP_NewsfeedAdvanced_Comment_Text_'+id).sep_nfa_show();
    }

    function 
    SEP_NewsfeedAdvanced_edit(idtype) {
        
    data_string '';
        if(
    type == 3) {
            
    data_string = $('comment_edit_form_'+id).toQueryString();
        }
             
        
    myreq2 = new Request({
            
    method'post',
            
    url'./user_newsfeed_advanced_ajax.php',
            
    data'_ajaxReq=1&task=edit&type='+type+'&id='+id+'&' data_string,
            
    onSuccess: function(html){ $('SEP_NewsfeedAdvanced_Text_'+id).sep_nfa_update(html.replace(/\\n/g'<br>')); $('SEP_NewsfeedAdvanced_Edit_'+id).sep_nfa_hide(); $('SEP_NewsfeedAdvanced_Text_'+id).sep_nfa_show(); },
            
    onFailure: function() {alert('Could not save your changes! Please try again!');}
        }).
    send();                 
    }


    function 
    SEP_NewsfeedAdvanced_delete(id) {
        
    myreq2 = new Request({
            
    method'post',
            
    url'./user_newsfeed_advanced_ajax.php',
            
    data'_ajaxReq=1&task=delete&id='+id,
            
    onSuccess: function(html){ $('SEP_NewsfeedAdvanced_BoxItem_'+id).destroy(); },
            
    onFailure: function() {alert('Could not delete this comment! Please try again!');}
        }).
    send();        
    }

    function 
    SEP_NewsfeedAdvanced_report(id) {
        
    myreq2 = new Request({
            
    method'post',
            
    url'./user_newsfeed_advanced_ajax.php',
            
    data'_ajaxReq=1&task=report&id='+id,
            
    onSuccess: function(){ $('SEP_NewsfeedAdvanced_ReportButton_'+id).destroy(); alert('Thank you for reporting this comment!'); },
            
    onFailure: function() {alert('Could not send your report! Please try again!');}
        }).
    send();            
    }

    function 
    SEP_NewsfeedAdvanced_toggle_box(action_iddisplay) {
            if(
    display == 'preview') {
                $(
    'SEP_NewsfeedAdvanced_Box_Final_'+action_id).sep_nfa_hide();    
                if(
    SEP_NewsfeedAdvanced_AutoGrow_Instance) {
                    $(
    'SEP_NewsfeedAdvanced_Textarea_'+action_id).setStyle('height'SEP_NewsfeedAdvanced_AutoGrow_Instance.textarea_old_height);        
                }
                $(
    'SEP_NewsfeedAdvanced_Box_Preview_'+action_id).sep_nfa_show();            
            }
            else {
                $(
    'SEP_NewsfeedAdvanced_Box_Preview_'+action_id).sep_nfa_hide();
                $(
    'SEP_NewsfeedAdvanced_Box_Final_'+action_id).sep_nfa_show();    
                $(
    'SEP_NewsfeedAdvanced_Textarea_'+action_id).focus();
            }
    }

    function 
    SEP_NewsfeedAdvanced_totally_hide_box(action_id) {
                $(
    'SEP_NewsfeedAdvanced_Box_Final_'+action_id).sep_nfa_hide();
                $(
    'SEP_NewsfeedAdvanced_Box_Preview_'+action_id).sep_nfa_show();
    }

    function 
    SEP_NewsfeedAdvanced_ScrollTo(action_id) {
        
    offset 300;
        
    div_position_y = $('SEP_NewsfeedAdvanced_Box_Final_'+action_id).getPosition().y;
        
    window.scrollTo(0div_position_y-offset);
    }

    function 
    SEP_NewsfeedAdvanced_Show_Hidden_Boxes(action_id) {
        $(
    'SEP_NewsfeedAdvanced_ShowMoreButton_'+action_id).sep_nfa_hide();
        $$(
    'div.SEP_NewsfeedAdvanced_Box_Hidden_'+action_id).each(function(elm){ elm.sep_nfa_show();});    
    }

    function 
    SEP_NewsfeedAdvanced_Check_MaxLength(field_idmax_length) {
        if($(
    field_id).value.length    max_length) {
            
    alert('Your comment is too long!');    
            return 
    false;
        }
        
        return 
    true;
    }


    function 
    SEP_NewsfeedAdvanced_ItemOptions(modeid) {
        if(
    mode == 'show') {
            $(
    'SEP_NewsfeedAdvanced_Box_Header_Right_Inactive_'+id).sep_nfa_hide();
            $(
    'SEP_NewsfeedAdvanced_Box_Header_Right_Active_'+id).sep_nfa_show();        
        }
        else {
            
    // $('SEP_NewsfeedAdvanced_Box_Header_Right_Active_'+id).sep_nfa_hide();            
            // $('SEP_NewsfeedAdvanced_Box_Header_Right_Inactive_'+id).sep_nfa_show();    
        
    }     
    }


       
    /* 
     * Copyright (c) 2009 Gary Glass (www.bookballoon.com)
     * Modified by SEplugins 
     */   
    var SEP_NewsfeedAdvanced_AutoGrow_Instance null;
    var 
    AutoGrow = new Class({

        Implements: [
    OptionsEvents],

        
    options: {
            
    interval333// update interval in milliseconds
            
    margin30// gap (in px) to maintain between last line of text and bottom of textarea
            
    minHeight20 // minimum height of textarea
        
    },
        
        
    periodical_timernull,
        
    textarea_old_height0,

        
    initialize: function(textareaoptions) {
            
    this.textarea = $(textarea);
            
    this.options.minHeight textarea.clientHeight;
            
    this.setOptions(options);
            
    this.dummy =  new Element("div", {
                
    styles:    {
                    
    "overflow-x" "hidden",
                    
    "position"   "absolute",
                    
    "top"        0,
                    
    "left"       "-9999px"
                
    }
            }).
    setStyles(this.textarea.getStyles("font-size""font-family""width""line-height""padding")).inject(document.body);
            
    this.textarea_old_height this.textarea.getStyle("height");
            
    this.resize();
            
    this.start();
        },

        
    resize: function() {
            var 
    html this.textarea.get('value').replace(/\n|\r\n/g'<br>X');
            if (
    this.dummy.get("html").toLowerCase() != html.toLowerCase()){
                
    this.dummy.set("html"html);
                var 
    triggerHeight this.dummy.getSize().this.options.margin;
                if (
    this.textarea.clientHeight != triggerHeight)
                {
                    var 
    newHeight Math.max(this.options.minHeighttriggerHeight);
                    
    this.textarea.tween("height"newHeight);
                }
            }
        },
        
        
    start: function() {
            
    this.periodical_timer this.resize.periodical(this.options.intervalthis);
        },
        
        
    stop: function() {
            
    $clear(this.periodical_timer);    
        }
        
        

    });   

    Fichiers attachés:

Partager cette page

All rights reserved SocEngine.ru ©