Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
coding-topic
Recent Forum Post Widget
Avatar
MDF
Rookie
sp_UserOfflineSmall Offline
Dec 17, 2016 - 11:06 am

Hello forum.

Is there a way for an excerpt of the comments to be shown as well?

I have been looking over the forum and only find related to postTip on mouseover.  I would like to see this instead displayed with the first 75 characters or so showing.

Thank you in advance for any guidance.

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Dec 17, 2016 - 7:50 pm

not in any particular way...  by its nature, the post content is not exposed there except for the tooltip...

if you want to force the display, you would be best off to copy the widget code over to your own and modify yourself.. wouldnt be hard to output the tooltip fixed below the title...  but afraid, we dont really expose enough hooks to do it easily now..  afraid this is the first time someone has asked for anything like that...

if you want to go that route, we can provide some additional guidance...

Avatar
MDF
Rookie
sp_UserOfflineSmall Offline
Dec 26, 2016 - 8:57 pm

Yes, I would be interested in some guidance.

sp_ListViewBodyStart();

sp_ColumnStart('tagClass=spColumnSection spLeft&width=60%&height=0');
sp_ListTopicName('', __sp('Go to %NAME%'));
sp_ColumnEnd();

I wasn't certain if there was a way to add the code that should show a certain number of characters of the topic.  For example, the title will stay hyperlinked, however the additional content would be plain text following the hyperlink.

Example:  

Topic Title - This text would be the first 100 characters in a post....

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Dec 26, 2016 - 11:41 pm

think you have lost me... we were talking about the recent post widget/tag...but the code you posted has nothing to do with that... so not sure where you were going there...  my suggestion was to edit an existing piece of code... you get all the inherited code with... you fragment is missing many things it would have to have...

I was suggesting modifying

                case 'T':
                    # Topic
                    $out.= $beforeTopic;
                    if ($tLink) $out.= "<a class='$linkClass' $title href='$spThisListTopic->post_permalink'>";
                    $out.= sp_truncate($spThisListTopic->topic_name, $truncate);
                      if ($tLink) $out.= '</a>';
                    $out.= $afterTopic;
                    break;

to something like

                case 'T':
                    # Topic
                    $out.= $beforeTopic;
                    if ($tLink) $out.= "<a class='$linkClass' href='$spThisListTopic->post_permalink'>";
                    $out.= sp_truncate($spThisListTopic->topic_name, $truncate);
                      if ($tLink) $out.= '</a>';
                      $out.= '<br/>'.$spThisListTopic->post_tip;
                    $out.= $afterTopic;
                    break;

this would output the excerpt under the topic title.. just change the <br/> tag to a dash to get closer to what you want..

and as mentioned, you really cant display html in an excerpt because odds are that you would break some html...

Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 650
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 620
Members: 17365
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10128
Posts: 79626