We build. You grow.

Get best community software here

Start a social network, a fan-site, an education project with oxwall - free opensource community software

Newsfeed .ow_remark | Forum

Kяuncн Leader
Kяuncн Nov 15 '13
Preview character count is at 930 from Forum post on Newsfeed, I need to change/Lower this count, any ideas?


The Forum post is edited by Kяuncн Nov 15 '13
dave Leader
dave Nov 16 '13

krunch do you still need this ?   I will find it for you if you do..

The Forum post is edited by dave Nov 16 '13
Petar Šlat
Petar Šlat Nov 16 '13
I think there is "UTIL_String::truncate($text, $length, '...')" that's responsible for character truncation count.


EDIT:

Just guestimating...

Since it's blog component and we are talking about a widget.

Look into ow_plugins/blogs/components/blog_widget


There you should find helper method I typed above.

In the constructor search for array $posts[] variable (around line 73).

It that array you will see that there is $previewLength variable.


Conclusion: widget has built in option for you to truncate the blog text.


... I totaly missed the target; we should search for a newsfeed observer or something similar to that.

Scrap that, look into ow_plugins/newsfeed/components


... run out of time, will look into it when I get back home :)


Maybe someone else can help?

The Forum post is edited by Petar Šlat Nov 16 '13
Kяuncн Leader
Kяuncн Nov 16 '13

Quote from dave

krunch do you still need this ?   I will find it for you if you do..


Yes, still need this, searched high n low at script, just couldn't find how to control character count at newsfeed for forum posts..
Kяuncн Leader
Kяuncн Nov 16 '13

Quote from Petar Šlat I think there is "UTIL_String::truncate($text, $length, '...')" that's responsible for character truncation count.


EDIT:

Just guestimating...

Since it's blog component and we are talking about a widget.

Look into ow_plugins/blogs/components/blog_widget


There you should find helper method I typed above.

In the constructor search for array $posts[] variable (around line 73).

It that array you will see that there is $previewLength variable.


Conclusion: widget has built in option for you to truncate the blog text.


... I totaly missed the target; we should search for a newsfeed observer or something similar to that.

Scrap that, look into ow_plugins/newsfeed/components


... run out of time, will look into it when I get back home :)


Maybe someone else can help?



Done this, looked through
entity_feed.php,
entity_feed_widget.php,
feed.php,
feed_item.php,
feed_list.php,
feed_widget.php,
likes.php,
my_feed_widget.php,
site_feed_widget.php,
template.php,
update_status.php
and
user_feed_widget.php,,, no luck thus far..
dave Leader
dave Nov 16 '13

I did find the css which is in ow_plugins/newsfeed/classes/event_handler.php  line 821

 

inside of   function satusUpdate

 

        $eventData = array(
            'content' => '<div class="ow_smallmargin ow_newsfeed_status_txt">' . $status . '</div> [ph:attachment]',
            'view' => array(
                'iconClass' => 'ow_ic_comment'
            ),

 

i have not yet found the text limiter thought but i will keep looking...it has to be close by.

dave Leader
dave Nov 16 '13

this might notification and not the update  but look in same file line 1349  

 

        'content' => UTIL_String::truncate($data['status'], 100, '...'),

 

and another on line 1290

 

 'status' => UTIL_String::truncate($status, 100, '...'),

 

and another on 1212

 

'status' => UTIL_String::truncate($status, 100, '...'),

 

 

sorry i thought you said 100 oops i will keep looking dang

 

The Forum post is edited by dave Nov 16 '13
dave Leader
dave Nov 16 '13

the size of that box is 400px so i think that is handled by

 

ow_plugins/notfications/views/components/notification_html.html  line 18

 

<div style="display: inline-block; word-wrap: break-word; vertical-align: top; width: 400px;">

    <div>{$item.string}</div>
                        {if $item.content}
                            <div style="font-size:11px;color:#666;">{$item.content}</div>
                        {/if}
                    </div>

 

so now i just have to backtrack item content or item string to see where it is set. .

 

problem is that i cant seem to find where item content, item context, or item string are assigned to smarty in any php file.

The Forum post is edited by dave Nov 16 '13
dave Leader
dave Nov 16 '13
i checked the cron, i even checked the table values to see if it was limited there and did not find it.  that field is long text or text  and i think it comes from the table newsfeed_staus or newsfeed_action   strange where is that thing..
Kяuncн Leader
Kяuncн Nov 17 '13

Quote from dave i checked the cron, i even checked the table values to see if it was limited there and did not find it.  that field is long text or text  and i think it comes from the table newsfeed_staus or newsfeed_action   strange where is that thing..

Mhmm, not sure either and I'd hate to change the wrong set of Length/Values lol

Re-checked at Newsfeed and  Character Count was at 969, this includes 3 periods at it's end, this was from a Posted Story at one of the Group forums, a story that consisted of 22,500 characters...
The Forum post is edited by Kяuncн Nov 17 '13
dave Leader
dave Nov 17 '13

my thought is that it would be a even number its prob not 970, i dont think the devs would set it as a strange number like 969.  My best guestimate would be its either 960 or 965  so ill check those out...

 

Also dont forget it could very well NOT be set as a truncated text space, it could be just a block that is 400 wide with a height limitation and have the overflow hidden via css, so we have to consider that it could be either way when are are looking..  that would explain the odd number. 

 

You might consider comparing two seperate posts and seeing if it is the same number of characters.  If it is not the same then we need to start looking at css

Kяuncн Leader
Kяuncн Nov 17 '13
.ow_remark
.ow_newsfeed_item_content
 .ow_newsfeed_content.ow_smallmargin
 .ow_newsfeed_context_menu_wrap
 .ow_canvas .ow_newsfeed_body
and
.ow_newsfeed .ow_newsfeed_item,,
wasn't seeing any set max-heights on those items.

Comparing 2 I found 958 and 928 on another.
The Forum post is edited by Kяuncн Nov 17 '13
dave Leader
dave Nov 17 '13
well if that much difference it cant be a static php setting or truncate unless it goes by percent and not a whole number.   i need to sleep for a while but when i get up i will make another attempt.
Kяuncн Leader
Kяuncн Nov 17 '13

Quote from dave well if that much difference it cant be a static php setting or truncate unless it goes by percent and not a whole number.   i need to sleep for a while but when i get up i will make another attempt.

Thanks...
dave Leader
dave Nov 19 '13
sorry krunch i failed...  maybe a team member can let us in on the secret lol...
Kяuncн Leader
Kяuncн Nov 19 '13

Quote from dave sorry krunch i failed...  maybe a team member can let us in on the secret lol...

You would think by now lol..
Daisy Team
Daisy Nov 21 '13
Krunch, if you are talking about the Forum topic, you can reduce the number of characters via /ow_plugins/forum/classes/event_handler.php. Find the following function:

public function feedOnEntityAdd( OW_Event $e )

Here you will see the following string:
$content = UTIL_String::truncate(strip_tags($postDto->text), 150, '...');

But the changes will be applied for the new items only.

If you are talking about the forum topic post, you can reduce the number of characters via /ow_plugins/forum/classes/event_handler.php. Find the following function:

public function feedOnItemRender( OW_Event $event )

Here you will see the following string:

$content = UTIL_String::truncate(strip_tags(str_replace("&nbsp;", "", $postDto->text)), 100, $postUrlEmbed);


If we took you wrong - please provide us with more details.
Kяuncн Leader
Kяuncн Nov 21 '13
/ow_plugins/forum/classes/event_handler.php
Don't have that file there,see screen-shot below..


I'm talking about what actually shows up on the Newsfeed after a member posts at either regular forum of Group forum, see screen-shot below.
(Text distorted due to adult content)


I'd like to cut this down by about 50%,,
The Forum post is edited by Kяuncн Nov 21 '13
Daisy Team
Daisy Nov 27 '13
Krunch, the screenshots you've provided and your problem explanation have confused me. Let's clear the situation.

You are showing the item about the new forum topic in the group on your first  screenshot. Meanwhile on the second screenshots you are showing the comment on the blog post, but all the time you are talking about the Group forum posts.

These are three different actions.

The first screenshot shows the item about the new forum topic in the group. To truncate this item text you should make changes in /ow_plugins/forum/init.php file, search for the forum_feed_on_entity_add function.

The second screenshot shows the simple comment to any site content regardless of if it's blog post or photo.

Now I understood that you want to truncate the original comment in the comment area.
If somebody comments on the, let's say, photo with the long text, the full text of this comment will show up.  This is how the comments feature works, the original comments are not truncated.

If you want the comment text to be truncated - you should redesign the comments functionality. It's a custom code modification, which requires the core files change.

P.S. Sorry for misleading, you are right there is no event_handler.php file in the oxwall 1.5.3.
Kяuncн Leader
Kяuncн Nov 27 '13
What I showed on both is what ends up at Newsfeed after posting at Forums and or Blogs, Newsfeed update on these items are too long, I'd like to shorten them..

...:not comment text at Newsfeed to an Item,, this is Not the issue I am having:...


The Forum post is edited by Kяuncн Nov 27 '13
Pages: 1 2 3 »