miniBB ® 

miniBB

®
Support Forums
  
 | Start | Register | Search | Statistics | File Bank | Manual |
Custom Tutorials and Modifications miniBB Support Forums / Custom Tutorials and Modifications /  
 

First 10 words of message in the Recent Topics list

 
 
Page  Page 3 of 4:  « Previous  1  2  3  4  Next »

Author Paul
Lead Developer 
#31 | Posted: 1 Feb 2007 08:33 
This is the line you need to look up in the script files bb_func_ldisc.php and bb_func_vtopic.php:

$lptxt=($textLd==1?$pVals[$topic][3]:strip_tags($pVals[$topic][3]));


change it to

$lptxt=($textLd==1?$pVals[$topic][3]:strip_tags(str_replace('<br />', ' ', $pVals[$topic][3])));

I've tried it locally and it absolutely works on my side (and will be fixed in the next release also).

Author Marius
Partaker
#32 | Posted: 1 Feb 2007 11:39 
Thank you sir...you guys proof to be top coders serving open source and beyond!

Author Moony
Partaker
#33 | Posted: 12 Feb 2007 02:47 
if you sort by new posts it is, but if you sort by New Topics it should be use the first post text.

if you want to show it even in case of New Posts sort type in the bb_func_ldisc.php try changing:

if($row=db_simpleSelect(0, $Tp, 'poster_id, poster_name, post_time, topic_id'.$textLdSql, '', '', '', 'post_id DESC'))

to:

if($row=db_simpleSelect(0, $Tp, 'poster_id, poster_name, post_time, topic_id'.$textLdSql, '', '', '', 'post_id ASC'))


This solution does not work. Is there any other way to show only the first post?

Author Paul
Lead Developer 
#34 | Posted: 12 Feb 2007 05:40 
I am sure the solution above works. I've just tested it locally and it worked.

I don't understand what do you want to achive. Set $sortingTopics option to 1, set $textLd option to 1 or 2 (if to 2, you will need to apply the change I've mentioned, since it is not included in the latest release 2.0.3). Paste {$lastPostText} in main_last_discuss_cell.html or main_topics_cell.html

If you don't $sortingTopics overriding the whole forum settings, but taking an effect only on the 1st page, put in bb_plugins.php:

if($action=='') $user_sort=1;

I am sure it will work and it will display the first message under the topic's title. It works with the latest release on my local copy.

Author Marius
Partaker
#35 | Posted: 12 Feb 2007 06:08 
I actually prefer to see the latest post under the topic for the "latest discussions", so that you don't have to go to post if not relevant to visit. Usually the first 10 words are enough indication of the nature of the post.

Plus it makes the "latest discussions" even more dynamic than it already is.

2 cents added...

Author Moony
Partaker
#36 | Posted: 12 Feb 2007 12:50 
I actually prefer to see the latest post under the topic for the "latest discussions", so that you don't have to go to post if not relevant to visit. Usually the first 10 words are enough indication of the nature of the post.
This solution is useful for creating news service on a website. Thanks to Paul, now it works fine.

Author Anonymous
Guest
#37 | Posted: 3 Aug 2007 13:36 
If they use a smilie, it doesn't show up as text.

I would like it if they can still display the characters instead of the image.

: )

Author Anonymous
Guest
#38 | Posted: 4 Aug 2007 08:08 
I think it would be neat for the user to determine whether or not there is text displayed or not. Some people like having just the topic titles listed, others like the summary.

Any way to display it so the user can decide?

Author Paul
Lead Developer 
#39 | Posted: 6 Aug 2007 09:36 
I would like it if they can still display the characters instead of the image

- This would be really a giant task for the server... specially if you have large amount of visitors. Anyway including addon_smilies.php file somewhere in bb_plugins.php and using decodeSmilies() function would do the job. It would take a lot of time to explain in full of how to do it, so if you are not familiar with PHP, welcome to our paid support.

Any way to display it so the user can decide

- I think introducing new field in user's profile, and then adjusting this algorithm so it fits the value of this field is not an impossible task. However, we could consider is only as paid job currently. No free solutions available, sorry.

Author dorian
Guest
#40 | Posted: 27 Jan 2010 08:49 
Sorry for bringing this topic back alive, but the topic I made was closed. When I put the {$lastPostText} in my main_topics_cell.html, it says 'N/A', instead of the last posts text. What am I doing wrong?

Author Paul
Lead Developer 
#41 | Posted: 27 Jan 2010 09:34 
Did you decommented/set up $textLd option in setup_options.php?

Author dorian
Guest
#42 | Posted: 27 Jan 2010 09:51 
Yea I just did that haha, I didn't think I had to add it to the setup_options.php. It's working great now, thanks :D

But, I have stumbled upon an other problem. Changing

if($row=db_simpleSelect(0, $Tp, 'poster_id, poster_name, post_time, topic_id'.$textLdSql, '', '', '', 'post_id DESC'))

to:

if($row=db_simpleSelect(0, $Tp, 'poster_id, poster_name, post_time, topic_id'.$textLdSql, '', '', '', 'post_id ASC'))


is not possible, since I can't find that piece of code in my bb_func_ldisc.php.

What I want to do is have the first bit of text of the original topic text (the first post) in it. I've read trough this topic many times, but I can't seem to understand how to do this.

Thanks for your help again!

Author Dorian
Partaker
#43 | Posted: 27 Jan 2010 09:56 
Can't edit my previous post since I was still a guest, but, instead of making a completely new topic, I will just ask it here if I may.. If I use a custom footer, the miniBB logo disappears, so there's no reference to your site. I don't want that, since I do not own a commercial license (yet), but is it ok if I put: sitename.com is powered by miniBB? If it's not, I will delete the footer of course.

edit: Is it also possible to limit the words and characters, so when someone types 10 words consisting of 50 characters, it would only show 50 characters, containing 10 words max.. I hope you get what I mean haha

Author Paul
Lead Developer 
#44 | Posted: 27 Jan 2010 10:15 
It's OK for the footer as soon there is a link to our website.

Answering the question: "Is it also possible..." - yes, it's possible.

There are different algorithms for displaying latest parts of text, so for each customer we usually develop only custom versions. If you want to sponsor one, I could provide you the codes here. Until now you may get the idea only from the above thread.

(Our opinion is: this text is not worth to put on the first page. It's bad for all aspects - traffic, SEO, forums look. So we're supporting it only as the custom solution.)

Author Dorian
Partaker
#45 | Posted: 27 Jan 2010 14:36 
Thanks again for your help! Though, I now have the problem the Recent Topics on the main page will sort on Newest Topics or show the text in the first post under the title. The option to sort by Most Recent Replies is gone now. Is there an option to show the text under the title and still be able to sort it in both ways?

The things I changed are:

bb_plugins.php
if (!defined('INCLUDED776')) die ('Fatal error.');
function parseTopic(){

/* Get first 10 words from post text - set $textLd=2; in setup before */
$lptxt=$GLOBALS['lastPostText'];
$sp=explode(' ', $lptxt);
if(sizeof($sp)>10) { $newTxt=''; for($i=0;$i<20;$i++) $newTxt.=$sp[$i].' '; $newTxt=trim($newTxt).'...'; }
else $newTxt=$lptxt;
$GLOBALS['lastPostTextShort']='<br /><span class="txtSm">'.$newTxt.'</span>';
/* --end of 10 words from post text code */

}
if($action=='') $user_sort=1;

setup_options.php
$sortingTopics=1;
$textLd=2;

bb_func_ldisc.php
if($user_sort==0) { $ordb='post_id'; $ordSql='ASC'; } else { $ordb='topic_id'; $ordSql='ASC'; } (on row 30)

mail_last_discuss_cell.html

{$lastPostTextShort} (obviously)

Page  Page 3 of 4:  « Previous  1  2  3  4  Next » 
Custom Tutorials and Modifications miniBB Support Forums / Custom Tutorials and Modifications /
 First 10 words of message in the Recent Topics list
 Share Topic's Link

Your Reply Click this icon to move up to the quoted message


  ?
Post as a Guest, leaving the Password field blank. You could also enter a Guest name, if it's not taken by a member yet. Sign-in and post at once, or just sign-in, bypassing the message's text.


Before posting, make sure your message is compliant with forum rules; otherwise it could be locked or removed with no explanation.

 

 
 
miniBB Support Forums Powered by Forum Software miniBB ® Home  Features  Requirements  Demo  Download  Showcase  Gallery of Arts
Compiler  Premium Extensions  Premium Support  License  Contact Us
Get the File and Picture Attachments add-on: extend your miniBB-forums, attaching images and files.


  ⇑