Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Topic started by: miseryshining on March 19, 2007, 05:37:32 PM

Title: Recent posts user preference
Post by: miseryshining on March 19, 2007, 05:37:32 PM
Link to Mod (http://custom.simplemachines.org/mods/index.php?mod=654)

recent topics page example
http://www.yourforum.com/index.php?action=recenttopics;boards=2,4;limit=1
(will show a list of recent topics from boards 2 and 4, limited to the last day)

supported filters:
boards=all; (all boards, overrides user preference)
boards=2,4; (board filter, overrides user preference)
limit=3; (days)
warning: this can cause performance issues. Admins can define a maximum timeframe to search in.
start=20; (pagination)

sorting:
sort=starter (etc);
desc (sorting)

configuration
[forum users]
"edit profile -> Recent posts preferences"
[admins]
SMF2: "configuration -> modifications -> Recent posts/topics"
SMF1: "features and options -> Recent posts/topics"

instructions to setup a recent posts/topics block
The recent posts block that is already embedded in most of the themes (on the board index) is automatically enhanced to reflect the user preferences. You can enable it from the theme's settings page. 

More flexible example: insert the following code where you want to display the block


require_once('location/to/SSI.php');
if (function_exists('ssi_recentPostsPref')) ssi_recentPostsPref();


hacks
add a dropdown box on the recent topics page for selection of nr of days (http://www.simplemachines.org/community/index.php?topic=158917.msg1671827#msg1671827)

Variables:
ssi_recentPostsPref( int $nrofPosts, string,array $boards, string $returnMode, int $mode, int $limit_days, int $member_id )

$nrofPosts:     
$boards:           
$returnMode:
------  'echo' (print the result on the page)
------  'extended' (creates a detailed array with recent topics, ala vBulletin. puts it in $context['topics'])
------  [anything else] (return an array with post/topic info)
$mode:           
------  1 (show all posts)
------  2 (show topics)
$limit_days
$member_id   
blue only applies to SMF 1.x
Title: Re: Recent posts user preference
Post by: NEMINI on March 19, 2007, 07:18:34 PM
is there something I need to do other then to call ssi_recentPostsPref() ?  Doing that I find the number of posts displayed does change depending what I have set in my profile, but no matter what I set for boards they all show (even if I unselect all boards).
Title: Re: Recent posts user preference
Post by: miseryshining on March 19, 2007, 09:01:09 PM
Quote from: NEMINI on March 19, 2007, 07:18:34 PM
is there something I need to do other then to call ssi_recentPostsPref() ?  Doing that I find the number of posts displayed does change depending what I have set in my profile, but no matter what I set for boards they all show (even if I unselect all boards).

No, it should work by just calling that function. I think it has to do with the the user array being cached for an X amount of time. It should refresh automatically. If you select no boards at all, it will display content from all boards by default.
Title: Re: Recent posts user preference
Post by: Yio on April 02, 2007, 04:41:17 PM
Hi! miseryshining,

I installed your mod but it doesn't has any effect it self, without modifying some code lines.

You said that we must call the ssi_recentPostsPref() function. I wonder if I must call that function instead of getLastPosts(), by changing the folowing code line in Sources/BoardIndex.php:

$context['latest_posts'] = getLastPosts($settings['number_recent_posts']);


The mod may need to be edited so as to that lines be modified by the mod.

;)
Title: Re: Recent posts user preference
Post by: Yio on April 02, 2007, 05:30:24 PM
I called the ssi_recentPostsPref() function instead of getLastPosts() and include the require_once('SSI.php');

The mod shows the RecentPosts but at the top of the index.

I guess that´s because of the ssi_recentPostsPref() function doesn't give the same format that getLastPosts() function.
Title: Re: Recent posts user preference
Post by: miseryshining on April 05, 2007, 09:10:11 AM
The mod shows preformatted list of topics wherever you call ssi_recentPostsPref(). You can call it everywhere in your templates. It doesn't make much sense to both ssi_recentPostsPref() and getLatestPosts() at the same time.

My implementation uses the functions provided in SSI.php for added flexibility. When you want it to return an array of values, you should use this code:


global $context;
if ($context['user']['recentPosts']['lastOnly'] == 1)
$topicArray = ssi_recentTopics($context['user']['recentPosts']['nrofPosts'], null, 'array', $context['user']['recentPosts']['boards']);
else
$topicArray = ssi_recentPosts($context['user']['recentPosts']['nrofPosts'], null, 'array', $context['user']['recentPosts']['boards']);
Title: Re: Recent posts user preference
Post by: Yio on April 05, 2007, 02:08:20 PM
Because I don´t want users take control of the last threads preferences, I just have pasted the ssi_recentTopics function at the Recent.php file and called it from Recent/BoardIndex.php, instead of using getLastPosts().

// this line was removed: $context['latest_posts'] = getLastPosts($settings['number_recent_posts']);
      $context['latest_posts'] = ssi_recentTopics();

I have removed the echo lines of the results and the line   if ($output_method != 'echo' || empty($posts)).
Just have leaved the return line.

I have modified the $num_recent limit to 30

function ssi_recentTopics($num_recent = 30, $exclude_boards = null, $output_method = 'echo', $include_boards = null)


I also removed the link from profile.

HOWEVER, I wish to thank you a lot for help me resolving a dilemma I had, by giving us your mod!
Title: Re: Recent posts user preference
Post by: miseryshining on April 06, 2007, 06:38:37 AM
Quote from: Yio on April 05, 2007, 02:08:20 PM
HOWEVER, I wish to thank you a lot for help me resolving a dilemma I had, by giving us your mod!
Glad to help, but i still don't understand how this mod helped you?
Title: Re: Recent posts user preference
Post by: Yio on April 06, 2007, 06:46:05 PM
Your mod was the better tool I found to accelerate the development of the feature I needed at my site, an easy way to face it, instead of wasting too much time into it because of I don´t have too much time to do it. Moreover, I´m not the Great Programmer!!
Thanks again!
;)
Title: Re: Recent posts user preference
Post by: S1L1C0N on April 10, 2007, 11:03:57 AM
Is there any way to edit recent.php to show a list of THREAD TITLES only?
Title: Re: Recent posts user preference
Post by: Yio on April 10, 2007, 06:50:53 PM
If you use the echo lines of the ssi_recentTopics function, take a look at this lines:

echo '
<table border="0" class="ssi_table">';
foreach ($posts as $post)
echo '
<tr>
<td align="right" valign="top" nowrap="nowrap">
[', $post['board']['link'], ']
</td>
<td valign="top">
<a href="', $post['href'], '">', $post['subject'], '</a>
', $txt[525], ' ', $post['poster']['link'], '
', $post['new'] ? '' : '<a href="' . $scripturl . '?topic=' . $post['topic'] . '.msg' . $post['new_from'] . ';topicseen#new"><img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/new.gif" alt="' . $txt[302] . '" border="0" /></a>', '
</td>
<td align="right" nowrap="nowrap">
', $post['time'], '
</td>
</tr>';
echo '
</table>';


and delete columns that you don´t want, like
<td align="right" valign="top" nowrap="nowrap">
[', $post['board']['link'], ']
</td>

if you don´t want to show board´s name

and

', $txt[525], ' ', $post['poster']['link'], '
', $post['new'] ? '' : '<a href="' . $scripturl . '?topic=' . $post['topic'] . '.msg' . $post['new_from'] . ';topicseen#new"><img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/new.gif" alt="' . $txt[302] . '" border="0" /></a>', '
</td>
<td align="right" nowrap="nowrap">
', $post['time'], '


so you will have only this:

echo '
<table border="0" class="ssi_table">';
foreach ($posts as $post)
echo '
<tr>

<td valign="top">
<a href="', $post['href'], '">', $post['subject'], '</a></td>
</tr>';
echo '
</table>';




If you use the function return you must edit the template that uses the array returned, at Themes/.../BoardIndex.template.php , below // Show lots of posts,
edit the lines:

<td class="middletext" valign="top" width=380><b>', $post['link'], '</td><td width=120 class="smalltext"></b> ', $txt[525], ' ', $post['poster']['link'], ' </td><td width=220 class="smalltext">(', $post['board']['link'], ')</td>
<td class="smalltext" align="right" nowrap="nowrap">', $post['time'], '</td>


so they look like this:

<td class="middletext" valign="top" width=380><b>', $post['link'], '</td>


Good luck!  ;)
Title: Re: Recent posts user preference
Post by: S1L1C0N on April 12, 2007, 11:52:54 AM
Is there any way of achieving this by just editing Recent.php ?
Title: Re: Recent posts user preference
Post by: miseryshining on April 13, 2007, 10:54:26 AM
Quote from: S1L1C0N on April 12, 2007, 11:52:54 AM
Is there any way of achieving this by just editing Recent.php ?

What exactly do you want to achieve? You could use a modified RecentPosts function (with modified query) to get the posts. There's no support for recent topics in Recent.php. 
Title: Re: Recent posts user preference
Post by: S1L1C0N on April 13, 2007, 03:02:03 PM
I'd love a list that looks EXACTLY like action=unread  that instead shows recent TOPICS in X number of days.

that would = heaven for a million users here in this community if anyone could figure it out.
Title: Re: Recent posts user preference
Post by: hvyhitter on April 23, 2007, 05:59:16 PM
man I am searching for the SAME thing.. not getting any response.. Sure the whole new posts since your last login is cool.. but i want to see that list with unread items too.
been searching these forums for now 3 days.. still nothing. although this SSI thing looks promising
Title: Re: Recent posts user preference
Post by: miseryshining on April 23, 2007, 07:59:02 PM
You could get something similar by requesting the result as an array, then formatting it the way you want to. Create a new action+page, include the formatted array, and you're done.

An option to select the maximum nr of days that users want to go back could be useful, so I'm willing to implement that.
Title: Re: Recent posts user preference
Post by: S1L1C0N on April 24, 2007, 08:20:14 AM
Quote from: miseryshining on April 23, 2007, 07:59:02 PM
You could get something similar by requesting the result as an array, then formatting it the way you want to. Create a new action+page, include the formatted array, and you're done.

An option to select the maximum nr of days that users want to go back could be useful, so I'm willing to implement that.




You DO know that if you really did this, youd be like GOD around here right? Its what everyone wants so bad and every other forum software has! Search and you will see... Oh IM GETTING EXCITED!
Title: Re: Recent posts user preference
Post by: hvyhitter on April 24, 2007, 08:32:51 AM
wow.. someone here is in sales.
Title: Re: Recent posts user preference
Post by: miseryshining on April 24, 2007, 09:46:18 AM
Ha, you guys seem really desperate, i can't let you down. I'll do the following:

-add a user definable option for nr of days to go back (is that a requirement? we could also use pagination, just like the unread posts listing).
-make it only display topics that have replies you haven't seen yet (right?).
-maybe create a template page that looks like the unread posts listing.
Title: Re: Recent posts user preference
Post by: S1L1C0N on April 24, 2007, 09:51:44 AM
Quote from: miseryshining on April 24, 2007, 09:46:18 AM
-add a user definable option for nr of days to go back (is that a requirement? we could also use pagination, just like the unread posts listing).

Correct, I'd say if you did it its the cherry ontop, my suggestion, GO FOR IT!

Quote
-make it only display topics that have replies you haven't seen yet (right?).

IF it can be made optional via a checkbox or something it would truely be incredible, however the default way its handled is just recent, not really ones you havent seen yet, even if you've seen it, it would show up there.  USUALLY, the ones with new replies are bolded, the ones where your username is the last posted is NOT bolded.

Quote
-maybe create a template page that looks like the unread posts listing.

WINNER.
Title: Re: Recent posts user preference
Post by: hvyhitter on April 26, 2007, 02:23:00 PM
Quote from: miseryshining on April 24, 2007, 09:46:18 AM
Ha, you guys seem really desperate, i can't let you down. I'll do the following:

-add a user definable option for nr of days to go back (is that a requirement? we could also use pagination, just like the unread posts listing).
-make it only display topics that have replies you haven't seen yet (right?).
-maybe create a template page that looks like the unread posts listing.

no no no no.. unread or READ i dont care.. the issue is I may click NEW and read it quick.. then go.. you know what.. I DO have a reply for that thread later.. and then I cant hit like latest thread listing and find it fast....

I cant believe no one has asked for a Vbulletin style "New posts" Option.. well only a Few have.. about 6 people that I saw in my search..

and the Vbulletin way is NOT the correct description of what new posts is in the vbulletin  world.. its more like

List posts (any READ or UNREAD) in cronological order starting with most recently updated one first.

I want to take this and make a button right next to the New posts button on the header.

i think THAT way of (incorrectly displaying) new posts is more condusive to posting. (From my vbulletin days.)

Plus I also like that after I post.. and hit new posts.. if I am the last person to post in that thread it is STILL listed as the most recent post.. even though i obviously read it all.

Thanks.. I have been going nuts.. my user community has been REALLY patient.. and they love the new board.. i love the way SMF gives me DATA! its awesome.. so.. I dont want to go back.. i just want that ONE piece of functionality back..
Title: Re: Recent posts user preference
Post by: S1L1C0N on April 26, 2007, 02:46:51 PM
Quote from: hvyhitter on April 26, 2007, 02:23:00 PM
Quote from: miseryshining on April 24, 2007, 09:46:18 AM
Ha, you guys seem really desperate, i can't let you down. I'll do the following:

-add a user definable option for nr of days to go back (is that a requirement? we could also use pagination, just like the unread posts listing).
-make it only display topics that have replies you haven't seen yet (right?).
-maybe create a template page that looks like the unread posts listing.

no no no no.. unread or READ i dont care.. the issue is I may click NEW and read it quick.. then go.. you know what.. I DO have a reply for that thread later.. and then I cant hit like latest thread listing and find it fast....

I cant believe no one has asked for a Vbulletin style "New posts" Option.. well only a Few have.. about 6 people that I saw in my search..

and the Vbulletin way is NOT the correct description of what new posts is in the vbulletin  world.. its more like

List posts (any READ or UNREAD) in cronological order starting with most recently updated one first.

I want to take this and make a button right next to the New posts button on the header.

i think THAT way of (incorrectly displaying) new posts is more condusive to posting. (From my vbulletin days.)

Plus I also like that after I post.. and hit new posts.. if I am the last person to post in that thread it is STILL listed as the most recent post.. even though i obviously read it all.

Thanks.. I have been going nuts.. my user community has been REALLY patient.. and they love the new board.. i love the way SMF gives me DATA! its awesome.. so.. I dont want to go back.. i just want that ONE piece of functionality back..


WORD FOR WORD EXACTLY WHAT I FEEL. THANK GOD IM NOT ALONE, LETS MAKE IT HAPPEN FINALLY FOLKS!
Title: Re: Recent posts user preference
Post by: hvyhitter on April 26, 2007, 04:57:09 PM
I just am Flabbergasted people dont ask for this more.. IMO.. if you got this on SMF.. in ADDITION to the New posts the way SMF does it.. I really HONESTLY cant think of why you would want to run Vbulletin..

Cant see the code unless your registered.. AS IF..
Title: Re: Recent posts user preference
Post by: miseryshining on April 27, 2007, 08:47:26 AM
Alright, let me get it straight. The thing you want is the functionality of this mod (when the user ticks "Only show the last reply of a thread", it displays thread titles chronologically) but displayed on a full page + pagination.

If that's all, i'll be able to fix it this weekend.
Title: Re: Recent posts user preference
Post by: S1L1C0N on April 27, 2007, 09:32:40 AM
Quote from: miseryshining on April 27, 2007, 08:47:26 AM
Alright, let me get it straight. The thing you want is the functionality of this mod (when the user ticks "Only show the last reply of a thread", it displays thread titles chronologically) but displayed on a full page + pagination.

If that's all, i'll be able to fix it this weekend.


Yes, what was listed above, COMBINED with the power of your mod and being able to exclude recents shown from certain catagories will just be AMAZING.
Title: Re: Recent posts user preference
Post by: goranbaxy on April 30, 2007, 01:19:03 PM
Hi, I have installed this mode but I don't see anywhere 'recent topics' on my forum, I have default theme.
Is there something else I have to do beside installing mod?
Thanks.
Title: Re: Recent posts user preference
Post by: miseryshining on May 01, 2007, 04:37:19 AM
Quote from: S1L1C0N on April 27, 2007, 09:32:40 AM
Quote from: miseryshining on April 27, 2007, 08:47:26 AM
Alright, let me get it straight. The thing you want is the functionality of this mod (when the user ticks "Only show the last reply of a thread", it displays thread titles chronologically) but displayed on a full page + pagination.

If that's all, i'll be able to fix it this weekend.


Yes, what was listed above, COMBINED with the power of your mod and being able to exclude recents shown from certain catagories will just be AMAZING.

nothing done yet, planning to work on it tonight / tomorrow

Quote from: goranbaxy on April 30, 2007, 01:19:03 PM
Hi, I have installed this mode but I don't see anywhere 'recent topics' on my forum, I have default theme.
Is there something else I have to do beside installing mod?
Thanks.

Read the mod's description?

Quote from: miseryshining You can display a recent posts list by callingb]ssi_recentPostsPref()[/b] in your template. You will also need to include SSI.php somewhere before calling the function.

so you will have to add something like this to your theme index template:


require_once('SSI.php');
ssi_recentPostsPref();

Title: Re: Recent posts user preference
Post by: hvyhitter on May 01, 2007, 10:21:52 AM
WEll any effort is appreciated.. The way SMF handles new posts is TOTALLY killing myusers post counts.. and it didnt need any help as the newly installed shoutbox gave it a pretty good hit too.. THAT was an unforseen consequence.
Title: Re: Recent posts user preference
Post by: hvyhitter on May 07, 2007, 01:50:19 PM
This is the "Recent Topics" part of the board that I now see on the bottom of my template.. right?

Is there a way of making this open in a window by itself.. and looking like it does on the first page.. as opposed to the second page where it is all spread out?

i am still looking for that original specs Silicon and I layed out.. but i have no problem modifying to fit my preferences.

what do you mean by this?

ssi_recentPostsPref()[/b] in your template. You will also need to include SSI.php somewhere before calling the function.

is there a way of putting that into a link..

for instance.. my current New posts tab on the top which i added is..

http://www.hvyhitter.com/index.php?action=unread;all

is there a way that i can make a button to call up that first page in a window all by itself?
I am no web programmer.. but I got a lot of energy for it.


Title: Re: Recent posts user preference
Post by: ladynada on May 11, 2007, 05:59:52 PM
have you tried:

http://heartdaughter.com/overcomers/index.php?action=unread;all;start=0;sort=last_post

???  that shows the OLDEST unread in all boards with the oldest messages first

arghh..

its a combo you are asking for, between unread all since last visit ( with no consideration for whether you replied on the thread or not ).

in other words, the * START * number needs to be SET to a place in the list that begins SINCE your last visit!

does that make sense?

nada
Title: Re: Recent posts user preference
Post by: ladynada on May 11, 2007, 06:10:38 PM
you will need to peruse sources/recent.php

because the people who are saying this would slow things down are correct, as there are warnings in the code about that.  you would have to combine looking for recent message since, AND if they are unread or not, then take the results and write some html to display it like the recent list does in the Recent.template.php...

is not this possible with SSI.php?

nada
Title: Re: Recent posts user preference
Post by: ladynada on May 11, 2007, 06:44:24 PM
crashed twice tryin to post this...

okay please try this on a board of your choice, it seems to work for me, for example, it skipped over a newer topic that I HAD seen, and listed the topics around it, both older and newer,that I had NOT seen.

http://heartdaughter.com/overcomers/index.php?action=unread;all;board=15.0;start=0;sort=last_post

it shows unread posts, with the oldest first, per board

if that works, it would easy to implement with SSI or just php by counting from board 1 to last, checking for access to the board and/or message, and setting up the html display the way you like


nada
Title: Re: Recent posts user preference
Post by: daveb47 on May 13, 2007, 12:40:30 PM
Trying to use this mod,
Dont understand this part


QuoteYou can display a recent posts list by calling ssi_recentPostsPref() in your template. You will also need to include SSI.php somewhere before calling the function.

Tried putting this into board_template but it does nothing,Could do withh some help please.

Title: Re: Recent posts user preference
Post by: miseryshining on May 13, 2007, 09:05:22 PM
Quote from: daveb47 on May 13, 2007, 12:40:30 PM
Trying to use this mod,
Dont understand this part

QuoteYou can display a recent posts list by calling ssi_recentPostsPref() in your template. You will also need to include SSI.php somewhere before calling the function.

Tried putting this into board_template but it does nothing,Could do withh some help please.

what exactly did you put in there? should be


require_once('SSI.php');
ssi_recentPostsPref();


that will print the recent posts listing, right where you put the code and according to your current preference.


I've finally added the possibility to generate a recent topic listing as requested (check out the attachment). I'd like to get some feedback on it. Basically i cut a part from Recent.php and integrated it with ssi_recentTopics(). It will use the same template that the unread posts function uses, with few minor changes. You can call it like this:

http://yourforum.com/index.php?action=recenttopics

to override the users board selection and display topics from all boards
http://yourforum.com/index.php?action=recenttopics;all

to display the last 40 topics (it will display a maximum of 50 at a time. default is 30)
http://yourforum.com/index.php?action=recenttopics;count=40

It shouldn't break any of the 'old' functionality.

*bugfix: the user preferences were reset after changing other profile settings. I will publish the fix together with the new version, after some more testing / feature enhancements.
For now, it's included in the attachment. Don't forget to uninstall the old version before installing a new one.
Title: Re: Recent posts user preference
Post by: daveb47 on May 14, 2007, 04:24:27 AM
Thats great,Works fine.Thanx.
Just one more thing that would improve appearence,Is there any way of putting a box/border arond it & maybe title as in shoutbox.

(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Flhttp%3A%2F%2Fgoldies-uk.com%2Fsmf2%2Fcapture.gif&hash=0f2bf86c516dd357ab48c12dffa6645f7b97d7ee)
Title: Re: Recent posts user preference
Post by: miseryshining on May 14, 2007, 05:16:52 AM
Quote from: daveb47 on May 14, 2007, 04:24:27 AM
Thats great,Works fine.Thanx.
Just one more thing that would improve appearence,Is there any way of putting a box/border arond it & maybe title as in shoutbox.
you could add a border to it by putting it inside a div. require_once('SSI.php');
echo '<div class="recentposts">';ssi_recentPostsPref();echo '</div>';
You can then style it from the theme settings in your administration panel and add a border, etc. .recentposts { border: 1px solid #000000; }
Title: Re: Recent posts user preference
Post by: daveb47 on May 14, 2007, 10:07:25 AM
Many thhanx for help,As you may have guessed i am very new to SMF stuff ??? :D

I have altered stylesheet by adding code at end.



.avatar_t
{
height: 65px;
width: 65px;
border: 1px solid #000000;
}

.hd_border_l{
background-image: url(images/hd_border_l.gif);
background-repeat: repeat-y;
}

.hd_border_r{
background-image: url(images/hd_border_r.gif);
background-repeat: repeat-y;
}

.recentposts { border: 1px solid #000000;
}


also  changed boardindex.php

</tr>
</table>
</div><div class="bdc" style="margin-bottom: 2ex;"><!-- blank --></div>';
}

   // display shoutbox
  if (function_exists('sbox')) sbox();

require_once('SSI.php');
echo '<div class="recentposts">';ssi_recentPostsPref();echo '</div>';

/* Each category in categories is made up of:
id, href, link, name, is_collapsed (is it collapsed?), can_collapse (is it okay if it is?),
new (is it new?), collapse_href (href to collapse/expand), collapse_image (up/down iamge),
and boards. (see below.) */
foreach ($context['categories'] as $category)


But cant get border to show.
Title: Re: Recent posts user preference
Post by: hvyhitter on May 14, 2007, 03:43:05 PM
actually i solved my own problem..

i installed TinyPortal.. it had EXACTLY what i was asking for as a DEFAULT on the right side.. and the install.. which is the SMF way.. couldnt have been easier.. I am getting to be quite the SMF guru it woudl appear.
Title: Re: Recent posts user preference
Post by: miseryshining on May 14, 2007, 04:16:01 PM
Quote from: hvyhitter on May 14, 2007, 03:43:05 PM
actually i solved my own problem..

i installed TinyPortal.. it had EXACTLY what i was asking for as a DEFAULT on the right side.. and the install.. which is the SMF way.. couldnt have been easier.. I am getting to be quite the SMF guru it woudl appear.


Nice to hear that you got it fixed, tinyportal is a nice package indeed. not sure what you mean with the SMF way. i personally think that many mods are very restrictive by forcing the user to use them in a limited way. that's why i choose to provide as much flexibility as possible, at the cost of ease of installation (although it's still very easy to setup).

@daveb47: not sure what's wrong, that code should work. you don't happen to have a black forum background?
Title: Re: Recent posts user preference
Post by: daveb47 on May 15, 2007, 05:34:32 AM
I think i am going to hide in a corner :-X
Black on black indeed :-[ :-[ :-[

Thanx miseryshining,You got it in one.

Is there any easy way to put "Recent Posts" at top of box?

Also would very much like to take away option of no. of posts to show from Profile & aet it t o 5 for everyone.
Title: Re: Recent posts user preference
Post by: miseryshining on May 15, 2007, 06:06:57 AM
Quote from: daveb47 on May 15, 2007, 05:34:32 AM
Is there any easy way to put "Recent Posts" at top of box?
You mean at the top of the page? if you want them to be shown permanently (on any forum page), you could insert the code in index.template.php

QuoteAlso would very much like to take away option of no. of posts to show from Profile & aet it t o 5 for everyone.
yes, i should add some administrative options. For now, you could override the user's preference by calling it like this:


require_once('SSI.php');
   if ($context['user']['recentPosts']['lastOnly'] == 1)
      ssi_recentTopics(5, null, 'echo', $context['user']['recentPosts']['boards']);
   else
      ssi_recentPosts(5, null, 'echo', $context['user']['recentPosts']['boards']);


btw, are you using version 2 of the mod? If so, did you find any problems?
Title: Re: Recent posts user preference
Post by: askepott on June 07, 2007, 03:05:20 PM
Quote from: miseryshining on May 15, 2007, 06:06:57 AM
Quote from: daveb47 on May 15, 2007, 05:34:32 AM
Is there any easy way to put "Recent Posts" at top of box?
You mean at the top of the page? if you want them to be shown permanently (on any forum page), you could insert the code in index.template.php

QuoteAlso would very much like to take away option of no. of posts to show from Profile & aet it t o 5 for everyone.
yes, i should add some administrative options. For now, you could override the user's preference by calling it like this:


require_once('SSI.php');
   if ($context['user']['recentPosts']['lastOnly'] == 1)
      ssi_recentTopics(5, null, 'echo', $context['user']['recentPosts']['boards']);
   else
      ssi_recentPosts(5, null, 'echo', $context['user']['recentPosts']['boards']);


btw, are you using version 2 of the mod? If so, did you find any problems?

do i have to install it first then add the codes on index.template file? or just add the codes on index.template.php? also, what codes should i put and where ?

*sorry for my ignorance,  i don't know much about coding but I'm happy that I was able to set up my forum with mods little by little thru reading on this forum ;D
Title: Re: Recent posts user preference
Post by: miseryshining on June 08, 2007, 08:36:27 AM
Quote from: askepott on June 07, 2007, 03:05:20 PM
do i have to install it first then add the codes on index.template file? or just add the codes on index.template.php? also, what codes should i put and where ?

*sorry for my ignorance,  i don't know much about coding but I'm happy that I was able to set up my forum with mods little by little thru reading on this forum ;D

You have to install the mod and then add the code to your template. Do you have any specific use for it?
Title: Re: Recent posts user preference
Post by: askepott on June 08, 2007, 10:05:14 AM
Is this the code you're talking about?
require_once('SSI.php');
   if ($context['user']['recentPosts']['lastOnly'] == 1)
      ssi_recentTopics(5, null, 'echo', $context['user']['recentPosts']['boards']);
   else
      ssi_recentPosts(5, null, 'echo', $context['user']['recentPosts']['boards']);


and yes, I really need to install it so that my members can see the recent post on the forum. my community is growing everyday, and even if i'm the admin it's really hard to catch up on everything lol
Title: Re: Recent posts user preference
Post by: miseryshining on June 08, 2007, 08:44:36 PM
Quote from: askepott on June 08, 2007, 10:05:14 AM
Is this the code you're talking about?
require_once('SSI.php');
   if ($context['user']['recentPosts']['lastOnly'] == 1)
      ssi_recentTopics(5, null, 'echo', $context['user']['recentPosts']['boards']);
   else
      ssi_recentPosts(5, null, 'echo', $context['user']['recentPosts']['boards']);


and yes, I really need to install it so that my members can see the recent post on the forum. my community is growing everyday, and even if i'm the admin it's really hard to catch up on everything lol

I updated the description with the code you'd generally need (at the bottom).
http://custom.simplemachines.org/mods/index.php?mod=654

You can create a link that points to /www.yourforums.com/index.php?action=recenttopics;
No need to include anything, just install the mod.
Title: Re: Recent posts user preference
Post by: JaGuR123 on June 08, 2007, 11:09:13 PM
Thanks very much this is best mod ever ;)

Can i add to wish list though ?

I would like to add something similar to this to boardIndex, where it lists the last three topic replies of a board next to the board name in the forum index.
example
<td>Board name <br/> Description</td><td><? ssi_recentPosts(board_id , limit=3) ?><d> posts<br/>topics</td>poster etc</td>
Title: Re: Recent posts user preference
Post by: miseryshining on June 09, 2007, 05:17:27 AM
Quote from: JaGuR123 on June 08, 2007, 11:09:13 PM
Thanks very much this is best mod ever ;)

Can i add to wish list though ?

I would like to add something similar to this to boardIndex, where it lists the last three topic replies of a board next to the board name in the forum index.
example
<td>Board name <br/> Description</td><td><? ssi_recentPosts(board_id , limit=3) ?><d> posts<br/>topics</td>poster etc</td>

if you edit the Boardindex template you should be able to do that already, but it'll mean a lot of extra queries (one per board). You could use
ssi_recentTopics(3, null, 'echo', array($boardID));
Title: Re: Recent posts user preference
Post by: JaGuR123 on June 09, 2007, 08:14:14 AM
Hi i have tried that but am having trouble,

This is what i have
echo '


            </td>
<td class="windowbg2">', ssi_recentTopics(3, null, 'echo', array($boardID));     ,'<td>

but i am getting this error

There was a problem loading the /Themes/orange-lt07/BoardIndex.template.php template or language file. Please check the syntax and try again - remember, single quotes (') often have to be escaped with a slash (\).

:'(
Title: Re: Recent posts user preference
Post by: miseryshining on June 09, 2007, 09:02:35 AM
Quote from: JaGuR123 on June 09, 2007, 08:14:14 AM
Hi i have tried that but am having trouble,

This is what i have
echo '


            </td>
<td class="windowbg2">', ssi_recentTopics(3, null, 'echo', array($boardID));     ,'<td>

but i am getting this error

There was a problem loading the /Themes/orange-lt07/BoardIndex.template.php template or language file. Please check the syntax and try again - remember, single quotes (') often have to be escaped with a slash (\).

:'(


remove the colon. Also, you have to find out what the variable is for the boardID's. probably $board['id'] instead of $boardID
Title: Re: Recent posts user preference
Post by: JaGuR123 on June 09, 2007, 09:51:46 AM
Thanks very much ;)


Also not very important, but is there a way to limit the length of the topic name , i guess this would have to be done when calling it from the database ?

My site is www.racehorsetalk.com.au

And very big thanks again

edit: Sorry to be a pain but if there is no topic in the board then it displays array instead of not displaying anything at all, is there a simple way of fixing this&nbsp; ??
Cheers
Title: Re: Recent posts user preference
Post by: miseryshining on June 12, 2007, 06:55:36 AM
Quote from: JaGuR123 on June 09, 2007, 09:51:46 AM
Thanks very much ;)


Also not very important, but is there a way to limit the length of the topic name , i guess this would have to be done when calling it from the database ?
You would have to process the data that is returned from the database. You can do it by calling the function with parameter 'array' instead of 'echo', but you'd need to display everything manually, which will need some PHP knowledge (and time).


Quote from: JaGuR123 on June 09, 2007, 09:51:46 AM
edit: Sorry to be a pain but if there is no topic in the board then it displays array instead of not displaying anything at all, is there a simple way of fixing this  ??
Cheers

Should work like this, hopefully:

<td class="windowbg2">';
ssi_recentTopics(3, null, 'echo', array($board['id']));
echo '<td>
Title: Re: Recent posts user preference
Post by: JaGuR123 on June 13, 2007, 07:06:43 AM
Thank you worked Great.

This has mdae my site so much better  8)

Cheers
Title: Re: Recent posts user preference
Post by: miseryshining on June 13, 2007, 10:43:11 AM
Quote from: JaGuR123 on June 13, 2007, 07:06:43 AM
Thank you worked Great.

This has mdae my site so much better  8)

Cheers

Glad it worked out for you, the link you posted ^^ doesn't work tho.
Title: Re: Recent posts user preference
Post by: JaGuR123 on June 13, 2007, 03:06:28 PM
Oops , sorry, i had the wrong url ;(
try this one, i have moddified the orange theme and am using TP
www.racehorsetalk.com.au

Also another thanks , much appreciated
Title: Re: Recent posts user preference
Post by: miseryshining on June 14, 2007, 07:38:05 AM
Quote from: JaGuR123 on June 13, 2007, 03:06:28 PM
Oops , sorry, i had the wrong url ;(
try this one, i have moddified the orange theme and am using TP
www.racehorsetalk.com.au

Also another thanks , much appreciated

hey, looks pretty nice! ^^

You should check your design in firefox though; the login fields are displayed next to the forum index, making the forum too wide to fit the average screen resolution.

Clearing the board index table with css (clear: both) will fix it.
Title: Re: Recent posts user preference
Post by: JaGuR123 on June 14, 2007, 03:06:08 PM
Not exactly sure what you mean with the css code, waht and where should put clear:both ?

And again , big thanks
Title: Re: Recent posts user preference
Post by: miseryshining on June 15, 2007, 04:08:27 AM
Quote from: JaGuR123 on June 14, 2007, 03:06:08 PM
Not exactly sure what you mean with the css code, waht and where should put clear:both ?

And again , big thanks

<table width="100%" cellspacing="0" cellpadding="0" border="0" style="clear: both;">

or edit one of the css files and add


table {
  clear: both;
}
Title: Re: Recent posts user preference
Post by: rokit on July 04, 2007, 06:17:07 AM
I posted a topic under "Script Help," however i can post it here:

QuoteHello,

I just recently installed the Recent post mod made by miseryshining, did everything the mod files said to do, uploaded all changed files, however the end result when I try to access the newly feature in profile:

"Unable to load the 'recentPosts' template."

I wasn't informed about a template that I needed to upload, only what files to edit.  If someone could please guide me through this issue, it would be much appreciated.

Thanks,
Rokit

Mod: http://custom.simplemachines.org/mods/index.php?mod=654
My Site: http://namitamaki.net/association/index.php (For Preference?)

EDIT:

I found out that it works in the default theme however not any other themes I have uploaded.  I just updated the "profile.template.php" in each theme folder however now, when I try to save my settings under "Recent post preferences," I get this error:

Unknown column 'recentpostBoards' in 'field list'
File: /home/ssnet620/public_html/namitamaki/association/Sources/Profile.php
Line: 1004

Could you please help me out miseryshining? =)
Title: Re: Recent posts user preference
Post by: miseryshining on July 20, 2007, 08:03:34 AM
Quote from: rokit on July 04, 2007, 06:17:07 AM
Could you please help me out miseryshining? =)

Hey Rokit, sorry for the late reply, have been very busy recently. how exactly did you update the profile.template.php files?
Title: Re: Recent posts user preference
Post by: flame baiter on July 21, 2007, 07:55:05 PM
Quote from: S1L1C0N on April 13, 2007, 03:02:03 PM
I'd love a list that looks EXACTLY like action=unread  that instead shows recent TOPICS in X number of days.

that would = heaven for a million users here in this community if anyone could figure it out.
yeah, most requested feature in our community...sigh :(
Title: Re: Recent posts user preference
Post by: flame baiter on July 21, 2007, 07:59:50 PM
Quote from: S1L1C0N on April 26, 2007, 02:46:51 PM
Quote from: hvyhitter on April 26, 2007, 02:23:00 PM
Quote from: miseryshining on April 24, 2007, 09:46:18 AM
Ha, you guys seem really desperate, i can't let you down. I'll do the following:

-add a user definable option for nr of days to go back (is that a requirement? we could also use pagination, just like the unread posts listing).
-make it only display topics that have replies you haven't seen yet (right?).
-maybe create a template page that looks like the unread posts listing.

no no no no.. unread or READ i dont care.. the issue is I may click NEW and read it quick.. then go.. you know what.. I DO have a reply for that thread later.. and then I cant hit like latest thread listing and find it fast....

I cant believe no one has asked for a Vbulletin style "New posts" Option.. well only a Few have.. about 6 people that I saw in my search..

and the Vbulletin way is NOT the correct description of what new posts is in the vbulletin  world.. its more like

List posts (any READ or UNREAD) in cronological order starting with most recently updated one first.

I want to take this and make a button right next to the New posts button on the header.

i think THAT way of (incorrectly displaying) new posts is more condusive to posting. (From my vbulletin days.)

Plus I also like that after I post.. and hit new posts.. if I am the last person to post in that thread it is STILL listed as the most recent post.. even though i obviously read it all.

Thanks.. I have been going nuts.. my user community has been REALLY patient.. and they love the new board.. i love the way SMF gives me DATA! its awesome.. so.. I dont want to go back.. i just want that ONE piece of functionality back..


WORD FOR WORD EXACTLY WHAT I FEEL. THANK GOD IM NOT ALONE, LETS MAKE IT HAPPEN FINALLY FOLKS!

sorry for my double-post but ZOMG I can't believe my eyes...I *so* second that...100% my thoughts. we switched from phpbb to smf and this is by far (!) the most requested thing on our board....

is this already here and does it work with 1.1.3?

EDIT: okay, wait...

our old phpbb-latest actually showed the last xx threads in which there was a post and not just the newest xx threads...so if an old thread got a reply, it would show up in the latest threads...so does this mod only show the newest xx threads OR the newest xx threads in which there was a new post?

(no matter if read or unread...)

okay, maybe I should make an example coz my English isn't exactly superb...

let's say a board has 5 threads!

A created Today at 10:41:52 AM
B created Yesterday at 08:03:00 PM
C created July 16, 2007, 07:55:47 PM
D created  July 12, 2007, 10:22:03 AM
E created  July 10, 2007, 04:23:26 PM

now, there are new posts in 3 of those threads:

A (newest reply)
B (second newest reply)
E (third newest reply)

then does your mod show

A
B
C
D
E

(just threads sorted by creation date)

or

A
B
E
C
D

(threads sorted by newest replies)

?

in this example it doesn't really matter (coz all of the threads show up in the latest anyway) but remember that on big boards you have thousands of threads and the latest only shows like 50 or something...so if it's option 1, you'd only see the newest threads but not the threads with the newest comments in that list...erm, did anyone get that? oh well...2:50 am, guess I should go to bed!  o.O
Title: Re: Recent posts user preference
Post by: miseryshining on July 23, 2007, 03:21:56 PM
Pretty much everything you guys ask for has been added already, so I'm not sure what more to add. Read the mods' description to find out how to make it all work.

The mod provides a list of all the latest threads, unread AND read. It also provides a flexible list of new posts (only unread). If you want a list of only unread threads, you can use the unread posts list that SMF provides.
Title: Re: Recent posts user preference
Post by: flame baiter on July 24, 2007, 06:03:53 AM
Okay, so we're using this mod now...

http://www.dachboden-wg.de/portal/index.php?option=com_smf&Itemid=104&action=recenttopics

Problems?

1. The "number of posts to show" setting has no effect
2. It always says "neu" (new) even if it's no new
3. "Only show the last reply of a thread" - what is this for? Nothing changes when it's ticked/unticked

Other than that, this is great...thanks tons!
Title: Re: Recent posts user preference
Post by: Benson on July 29, 2007, 02:06:09 PM
Great mod - is there any chance to only have the new-symbol only for topics which are really unread?
Title: Re: Recent posts user preference
Post by: flame baiter on August 03, 2007, 07:37:48 AM
Any way to make this show up all polls in a list? That would be great!
Title: Re: Recent posts user preference
Post by: Guy Verschuere on August 04, 2007, 01:58:36 AM
Why does http://forum.cindyenguy.be/index.php?action=recenttopics;count=50;limit=1;all shows last 50 post instead of last day?
And http://forum.cindyenguy.be/index.php?action=recenttopics;count=50 shows only 25 topics?

Thanks
Title: Re: Recent posts user preference
Post by: JaGuR123 on August 19, 2007, 07:32:09 PM
Hi miseryshining,

Is it possible to ask for an addition to this recentposts mod.

I would love to be able to list recent posts by user id, there is the SMF version that does the Posts , but i just want the thread title , not the whole post.

I am already loving your MOD, you can see it in action at www.racehorsetalk.com.au
Title: Re: Recent posts user preference
Post by: franklinrony on September 11, 2007, 02:12:01 PM
can anyone helpme please, rhe mod install fine, i see in the panel th eoption to select the board to monitor, i check some boards, but when clic in  show recent topics all boards are show, need edit some file more
Title: Re: Recent posts user preference
Post by: miseryshining on October 10, 2007, 07:21:44 PM
sorry for the lack of replies, somehow the notifications didn't reach my inbox. I will get back to the support request the coming week.

Quote from: frony on September 11, 2007, 02:12:01 PM
can anyone helpme please, rhe mod install fine, i see in the panel th eoption to select the board to monitor, i check some boards, but when clic in  show recent topics all boards are show, need edit some file more

what version of SMF are you using?

Did anyone test the mod with version 1.1.4? Encountered any problems?
Title: Re: Recent posts user preference
Post by: miseryshining on October 11, 2007, 10:14:10 AM
Quote from: flame baiter on July 24, 2007, 06:03:53 AM
Okay, so we're using this mod now...

http://www.dachboden-wg.de/portal/index.php?option=com_smf&Itemid=104&action=recenttopics

Problems?

1. The "number of posts to show" setting has no effect
2. It always says "neu" (new) even if it's no new
3. "Only show the last reply of a thread" - what is this for? Nothing changes when it's ticked/unticked

Other than that, this is great...thanks tons!
2 should work for logged on users.
1 and 3 are only used for the ssi_recentPostsPref(), not for the recenttopics listing. I'll see if I can make this more obvious.
Quote from: flame baiter on August 03, 2007, 07:37:48 AM
Any way to make this show up all polls in a list? That would be great!
That would be quite a different feature, not something that fits in this mod well.
Quote from: guyverschuere on August 04, 2007, 01:58:36 AMWhy does http://forum.cindyenguy.be/index.php?action=recenttopics;count=50;limit=1;all shows last 50 post instead of last day?And http://forum.cindyenguy.be/index.php?action=recenttopics;count=50 shows only 25 topics?Thanks
this is fixed in version 2.2
Quote from: JaGuR123 on August 19, 2007, 07:32:09 PMHi miseryshining,Is it possible to ask for an addition to this recentposts mod.I would love to be able to list recent posts by user id, there is the SMF version that does the Posts , but i just want the thread title , not the whole post.I am already loving your MOD, you can see it in action at www.racehorsetalk.com.au
i attached a package that makes it possible, but only by including the following code in one of the template files (you can also create a new template file off course and include it in that). This will display recent posts by the user that is logged onglobal $context;require_once("SSI.php");ssi_recentPosts($context['user']['recentPosts']['nrofPosts'], null, 'echo', null, $context['user']['id']);
Title: Re: Recent posts user preference
Post by: miseryshining on October 11, 2007, 01:11:05 PM
New in 2.2: 
you can configure whether the extra options for recent post blocks are shown in the profile. Look under "Features and Options => user preferences. These options are useless if you only use the recenttopics list. 

Another new feature is the possibility to list recent posts by a single member (without the body), for example like this: 
global $context;
require_once("SSI.php");
ssi_recentPosts($context['user']['recentPosts']['nrofPosts'], null, 'echo', null, $context['user']['id']);

You can include that in any template file (or create a new page/template). 

Title: Re: Recent posts user preference
Post by: JaGuR123 on October 11, 2007, 03:20:21 PM
Thanks Miseryshining , will have a look at it after golf this morning
Title: Re: Recent posts user preference
Post by: JaGuR123 on October 12, 2007, 03:54:47 AM
Having some trouble manually installing this MS , i am up to the SSI.php and in searching for this line
AND b.ID_BOARD NOT IN (" . implode(', ', $exclude_boards) . ")") . "
there is no line but there is 3 of these
AND b.ID_BOARD NOT IN (" . implode(', ', $exclude_boards) . ")") . (!empty($include_boards) ? "
and if i replace it with
AND b.ID_BOARD IN (" . implode(',AND b.ID_BOARD NOT IN (" . implode(', ', $exclude_boards) . ")") . (!empty($include_boards) ? " ', $include_boards) . ")"  : '') . (isset($_REQUEST['limit']) && is_numeric($_REQUEST['limit']) ? "
   AND m.posterTime > " . (time() - ($_REQUEST['limit']*24*60*60)) : '') . (!empty($member_id) ? "
   AND m.ID_MEMBER = {$member_id}" : '') . "

I get an error, i was using 2.1 i think, and some of the stuff i needed to replace was already in the old version
Any help appreciated
Title: Re: Recent posts user preference
Post by: miseryshining on October 12, 2007, 04:04:17 AM
Quote from: JaGuR123 on October 12, 2007, 03:54:47 AM
Having some trouble manually installing this MS , i am up to the SSI.php and in searching for this line
AND b.ID_BOARD NOT IN (" . implode(', ', $exclude_boards) . ")") . "
there is no line but there is 3 of these
AND b.ID_BOARD NOT IN (" . implode(', ', $exclude_boards) . ")") . (!empty($include_boards) ? "
and if i replace it with
AND b.ID_BOARD IN (" . implode(',AND b.ID_BOARD NOT IN (" . implode(', ', $exclude_boards) . ")") . (!empty($include_boards) ? " ', $include_boards) . ")"  : '') . (isset($_REQUEST['limit']) && is_numeric($_REQUEST['limit']) ? "
   AND m.posterTime > " . (time() - ($_REQUEST['limit']*24*60*60)) : '') . (!empty($member_id) ? "
   AND m.ID_MEMBER = {$member_id}" : '') . "

I get an error, i was using 2.1 i think, and some of the stuff i needed to replace was already in the old version
Any help appreciated

I'd advise against doing stuff manually unless you really know what you're doing. It's very easy to defect your SMF installation with mods that are not properly deinstalled. That said, you could try to replace the whole query with

// Find all the posts.  Newer ones will have higher IDs.
$request = db_query("
SELECT
m.posterTime, m.subject, m.ID_TOPIC, m.ID_MEMBER, m.ID_MSG, m.ID_BOARD, b.name AS bName,
IFNULL(mem.realName, m.posterName) AS posterName, " . ($user_info['is_guest'] ? '1 AS isRead, 0 AS new_from' : '
IFNULL(lt.ID_MSG, IFNULL(lmr.ID_MSG, 0)) >= m.ID_MSG_MODIFIED AS isRead,
IFNULL(lt.ID_MSG, IFNULL(lmr.ID_MSG, -1)) + 1 AS new_from') . ", LEFT(m.body, 384) AS body, m.smileysEnabled
FROM ({$db_prefix}messages AS m, {$db_prefix}boards AS b)
LEFT JOIN {$db_prefix}members AS mem ON (mem.ID_MEMBER = m.ID_MEMBER)" . (!$user_info['is_guest'] ? "
LEFT JOIN {$db_prefix}log_topics AS lt ON (lt.ID_TOPIC = m.ID_TOPIC AND lt.ID_MEMBER = $ID_MEMBER)
LEFT JOIN {$db_prefix}log_mark_read AS lmr ON (lmr.ID_BOARD = m.ID_BOARD AND lmr.ID_MEMBER = $ID_MEMBER)" : '') . "
WHERE m.ID_MSG >= " . ($modSettings['maxMsgID'] - 25 * min($num_recent, 5)) . "
AND b.ID_BOARD = m.ID_BOARD" . (empty($exclude_boards) ? '' : "
AND b.ID_BOARD NOT IN (" . implode(', ', $exclude_boards) . ")") . (!empty($include_boards) ? "
AND b.ID_BOARD IN (" . implode(', ', $include_boards) . ")"  : '') . (isset($_REQUEST['limit']) && is_numeric($_REQUEST['limit']) ? "
AND m.posterTime > " . (time() - ($_REQUEST['limit']*24*60*60)) : '') . (!empty($member_id) ? "
AND m.ID_MEMBER = {$member_id}" : '') . "
AND $user_info[query_see_board]
ORDER BY m.ID_MSG DESC
LIMIT $num_recent", __FILE__, __LINE__);


In case you made other changes to the query, this won't work obviously.
Title: v2.3 Instructions
Post by: miseryshining on October 12, 2007, 01:07:42 PM
count is not supported anymore for the recent topics list. Forpagination, it will now use the value from "Posts and Topics ->Topic Settings => Number of topics per page in the message index:"

example
http://www.yourforum.com/index.php?action=recenttopics;boards=2,4;limit=1
(will show a list of recent topics from boards 2 and 4, limited to the last day)

supported filters:
boards=all; (all boards, overrides user preference)
boards=2,4; (board filter, overrides user preference)
limit=3; (days)
start=20; (pagination)
sort=starter;
desc (sorting)

configuration

[forum users]
"edit profile -> Recent posts preferences"
[admins]
"features and options -> user preferences"
instructions to setup a recent posts/topics block

Example: Insert the following code where you want to display the block


require_once('SSI.php');
if (function_exists('ssi_recentPostsPref')) ssi_recentPostsPref();


parameters

ssi_recentPostsPref( int $nrofPosts, string $boards, string $returnMode, int $mode, int $member_id )

$nrofPosts:     
$boards:           
$returnMode:
$mode:           
$member_id   
Title: Re: Recent posts user preference
Post by: JaGuR123 on October 12, 2007, 08:22:24 PM
Quote from: miseryshining on October 12, 2007, 04:04:17 AM
I 'd advise against doing stuff manually unless you really know what you 're doing. It 's very easy to defect your SMF installation with mods that are not properly deinstalled. That said, you could try to replace the whole query with

I am running a customized custom theme and the only way i can install most mods is to do them manually.

I figured out my problem , and i feel quite silly ... your latest mod is installing from a fresh install and because i had the last version of this mod already installed when i was searching for the code to change of course it was different because it had all ready been changed from the previous installation  :(

Some other quick questions MS is it possible to display more then 50 latest recentTopics mine only seems to be showing around 30 , also with the lastest mod are there any extra options the user or admin can change as it can 't see any.

Cheers and thanks again for a great mod
Title: Re: Recent posts user preference
Post by: miseryshining on October 12, 2007, 09:52:54 PM
Quote from: JaGuR123 on October 12, 2007, 08:22:24 PM
Quote from: miseryshining on October 12, 2007, 04:04:17 AM
I 'd advise against doing stuff manually unless you really know what you 're doing. It 's very easy to defect your SMF installation with mods that are not properly deinstalled. That said, you could try to replace the whole query with

I am running a customized custom theme and the only way i can install most mods is to do them manually.

I figured out my problem , and i feel quite silly ... your latest mod is installing from a fresh install and because i had the last version of this mod already installed when i was searching for the code to change of course it was different because it had all ready been changed from the previous installation  :(

Some other quick questions MS is it possible to display more then 50 latest recentTopics mine only seems to be showing around 30 , also with the lastest mod are there any extra options the user or admin can change as it can 't see any.

Cheers and thanks again for a great mod

try in the admin panel: "Posts and Topics -> Topic Settings => Number of topics per page in the message index:". Shouldn't limit you to a max value as far as I know.

btw, seems the SMF credits at the bottom of your site disappear in the background, you should fix that  :)
Title: Re: Recent posts user preference
Post by: JaGuR123 on October 12, 2007, 10:30:03 PM
Quote from: miseryshining on October 12, 2007, 09:52:54 PM
try in the admin panel: "Posts and Topics -> Topic Settings => Number of topics per page in the message index:". Shouldn't limit you to a max value as far as I know.

Yes i have done that, seems that it has something to do with how long the recentTopics stay recent, is there a way of making them display for longer , it seems it is only showing up 33 recent topics, but i would prefer it to be 50 to 100  :( ?


Quote from: miseryshining on October 12, 2007, 09:52:54 PM
btw, seems the SMF credits at the bottom of your site disappear in the background, you should fix that  :)

Yes i am in the processes of changing my colour scheme/s to someting that looks good (still working on it) , and it now blends into the background , i will fix it asap ;)
Title: Re: Recent posts user preference
Post by: ES23 on October 13, 2007, 06:45:42 AM
Hi!

I'm running SMF 1.1.4 and wish to install yr recent posts user preference 2.3 ...

But I've got a test unsuccessful for Recent.template.php

Tried manual install for that file but the part where


<a href="', $scripturl, '?action=unread',


needs to be replaced by

<a href="', $scripturl, '?action=', $_REQUEST['action'],

I realised that there is a few "<a href="', $scripturl, '?action=unread'," in my Recent.template.php file.Am I supposed to do the above modification for all "<a href="', $scripturl, '?action=unread', " that I see?

Attached to this post is my Recent.template.php file. Please advise :) Thanks.
Title: Re: Recent posts user preference
Post by: miseryshining on October 13, 2007, 07:33:08 AM
Quote from: JaGuR123 on October 12, 2007, 10:30:03 PM
Quote from: miseryshining on October 12, 2007, 09:52:54 PM
try in the admin panel: "Posts and Topics -> Topic Settings => Number of topics per page in the message index:". Shouldn't limit you to a max value as far as I know.

Yes i have done that, seems that it has something to do with how long the recentTopics stay recent, is there a way of making them display for longer , it seems it is only showing up 33 recent topics, but i would prefer it to be 50 to 100  :( ?

That's hard to accomplish since we are displaying recent threads here. If, for instance, only 10 threads on your board are active at the same time, and those threads all have 15 new posts, it will only display those 10 threads, and a few others. currently the query will only check the last 175 posts (for performance reasons).

You can up that number in SSI.php. look for the following code and change 5 to something higher (don't go too high though).
min($num_recent, 5)

Quote from: ES23 on October 13, 2007, 06:45:42 AM
Hi!

I'm running SMF 1.1.4 and wish to install yr recent posts user preference 2.3 ...

But I've got a test unsuccessful for Recent.template.php

Tried manual install for that file but the part where


<a href="', $scripturl, '?action=unread',


needs to be replaced by

<a href="', $scripturl, '?action=', $_REQUEST['action'],

I realised that there is a few "<a href="', $scripturl, '?action=unread'," in my Recent.template.php file.Am I supposed to do the above modification for all "<a href="', $scripturl, '?action=unread', " that I see?

Attached to this post is my Recent.template.php file. Please advise :) Thanks.

Hi, you need to replace all 5 of them, yes.
Title: Re: Recent posts user preference
Post by: ES23 on October 13, 2007, 10:27:35 AM
Hi!

Thanks for yr help.I've installed Recent Posts User Preference 2.3 successfully on SMF 1.1.4.

I know it's dumb to ask this question but after reading all the posts on this topic,I saw on page 2-3,the discussion over recent topics with only the topic name displayed like vbulletin style.And I saw on the 2nd bottom pic of recent posts user preference mod download page,an image of topics displayed in threads.I wanted to achieve that as well but I cannot understand the earlier replies.miseryshining mentioned to read the mod description and I have already read them.If that's the case,what does the 2nd pic on the mod page shows?

And can I know what are the different buttons and settings buttons added to the any part of the forums after installation of this mod and where are their location?There's only 2 right?One is under admin>>features and options>>user preferences and the other under user cp>>recent posts preferences,that's all right?
Title: Re: Recent posts user preference
Post by: ES23 on October 13, 2007, 11:08:42 AM
Hey ..I understand already the query I ask earlier ...

Some errors I got...

8: Undefined variable: board_limits
File: /var/www/html/forums/Sources/Recent.php
Line: 1331

8: Undefined variable: scripturl
File: /var/www/html/forums/Sources/Recent.php
Line: 1317

8: Undefined variable: board_limits
File: /var/www/html/forums/Sources/Recent.php
Line: 1309

8: Undefined variable: scripturl
File: /var/www/html/forums/Sources/Recent.php
Line: 1309

8: Undefined index: querystring_board_limits
File: /var/www/html/forums/Sources/Recent.php
Line: 1300

8: Undefined variable: scripturl
File: /var/www/html/forums/Sources/Recent.php
Line: 1300

8: Undefined index: boards
File: /var/www/html/forums/Sources/Recent.php
Line: 1248

8: Undefined variable: exclude_boards
File: /var/www/html/forums/Sources/Recent.php
Line: 1240

8: Undefined variable: board_limits
File: /var/www/html/forums/Sources/Recent.php
Line: 1331

8: Undefined variable: scripturl
File: /var/www/html/forums/Sources/Recent.php
Line: 1317

8: Undefined variable: board_limits
File: /var/www/html/forums/Sources/Recent.php
Line: 1309

8: Undefined index: boards
File: /var/www/html/forums/Sources/Recent.php
Line: 1248

All this errors repeat itself whenever I try to access my website: www.website.com/forums/index.php?action=recenttopics ... can someone help??Thanks :) Attached to this post is my Recent.php file ...
Title: Re: Recent posts user preference
Post by: miseryshining on October 13, 2007, 01:34:43 PM
thanks for the report, all of these should be fixed now, please uninstall the mods and re-download the latest version. None of these warnings was compromising the functionality, btw.

edit: I've added detailed instructions to the first post of this topic. Read it for extended configuration options
Title: Re: Recent posts user preference
Post by: ES23 on October 14, 2007, 12:32:02 AM
Great mod!All my errors seemed resolved :) Thanks!

Just an extra query about your edited first post:

Quote from: miseryshininginstructions to setup a recent posts/topics block
Example: Insert the following code where you want to display the block

require_once('SSI.php');
if (function_exists('ssi_recentPostsPref')) ssi_recentPostsPref();



Syntax:
ssi_recentPostsPref( int $nrofPosts, string $boards, string $returnMode, int $mode, int $member_id )

$nrofPosts:     

    * override user preference,
    * default: null

$boards:           

    * override board selection
    * possible values: board numbers seperated by commas
    * default: null

$returnMode:

    * how the list is returned
    * possible values:       

------  'echo' (print the result on the page)
------  'extended' (creates a detailed array with recent topics, ala vBulletin. puts it in $context['topics'])
------  [anything else] (return an array with post/topic info)

    * default: 'echo'
    * peculiarities:  applies only for recent topics, for recent posts, it will fallback to 'echo' mode

$mode:           

    * override posts/topics mode
    * possible values:

------  1 (show all posts)
------  2 (show topics)

    * default: 1                     

$member_id   

    * show only posts by one member
    * default: null

So all this modification needs to be done manually on the php files and cannot be accessed via backend administration?All the above code modifications aren't included in the installation of this mod and need to be additionally done on the files AFTER installation to extend configuration options?Errrm .... ... so,on which php files am I supposed to make all the above respective changes?Please advise.Thanks alot! :)
Title: Re: Recent posts user preference
Post by: miseryshining on October 14, 2007, 07:12:29 AM
Quote from: ES23 on October 14, 2007, 12:32:02 AM

So all this modification needs to be done manually on the php files and cannot be accessed via backend administration?All the above code modifications aren't included in the installation of this mod and need to be additionally done on the files AFTER installation to extend configuration options?Errrm .... ... so,on which php files am I supposed to make all the above respective changes?Please advise.Thanks alot! :)

Well, the idea is that you can place such a block wherever you'd like. For instance, you could put it somewhere in your index.template.php and it'll display a block on every page. This, you can actually do from the admin pages, where you can manually edit the index files :-). You will possibly need to style it a bit, and it helps if you know a bit of PHP/HTML/CSS. To use the default settings you can simply use the example i provided.

Since most people don't use the default theme, there's no way to provide this functionality without any manual code editing.
Title: Re: Recent posts user preference
Post by: FragaCampos on October 14, 2007, 11:22:07 AM
Question: This mod only works with the english package installed, right? I mean, i have a portuguese forum and when i installed this mod, nothing happened...
Title: Re: Recent posts user preference
Post by: miseryshining on October 14, 2007, 01:00:09 PM
Quote from: FragaCampos on October 14, 2007, 11:22:07 AM
Question: This mod only works with the english package installed, right? I mean, i have a portuguese forum and when i installed this mod, nothing happened...

What do you expect to "happen"? Please be a bit more specific ;-)

I think the English language files are always there anyways? You might need to add the language strings to your language files. It should still function right, even without the language strings

These are the strings that you should add:

/Themes/default/languages/Profile.english.php
$txt['RP_title'] = 'Recent posts settings';
$txt['RP_info'] = 'Here you can setup preferences for the recent post box.';
$txt['RP_lastOnly'] = 'Only show the last reply of a thread';
$txt['RP_nrofPosts'] = 'Number of posts to show';
$txt['RP_recentPosts'] = $txt['recentPosts'] = 'Recent posts preferences';
$txt['RP_listheader'] = 'check the boards you want to monitor';

/Themes/default/languages/ModSettings.english.php
$txt['userprefs_title'] = 'User preferences';
$txt['userprefsMode'] = 'Enable extra user preferences for recent post blocks';

/Themes/default/languages/index.english.php
$txt['recent_topics'] = 'Recent topics';
$txt['unread_topics_only'] = 'show unread only';

Title: Re: Recent posts user preference
Post by: FragaCampos on October 14, 2007, 01:45:52 PM
Wasn't supposed to show a box with recent posts on top of the fórum like in this (http://www.fivearts.net/index.php) forum? If true, on my forum nothing happened...

Anyway, i must add those string to the portuguese-utf8.php files? (and translate them, ofcourse)

Thanks for your help.

Title: Re: Recent posts user preference
Post by: miseryshining on October 14, 2007, 03:12:58 PM
Quote from: FragaCampos on October 14, 2007, 01:45:52 PM
Wasn't supposed to show a box with recent posts on top of the fórum like in this (http://www.fivearts.net/index.php) forum? If true, on my forum nothing happened...

No, you need to call the function inside the templates, you can find an example in the first post of this thread. The site you refer to uses a block that is embedded by default in most themes. you can enable it in the theme settings. This block is converted to reflect the user preference by this mod.

QuoteAnyway, i must add those string to the portuguese-utf8.php files? (and translate them, ofcourse)
yes, you should add them with translations there.

I just added a new string to Profile.english.php:
$txt['RP_blockSettings'] = 'Settings for blocks';

Title: Re: Recent posts user preference
Post by: hvyhitter on October 15, 2007, 11:39:36 AM
miseryshining! I JUST installed your mod and on my board with 61 modifications it installed with ZERO problems..

WOW.. awesome product.. me not having and install issue is a MIRACLE..

cant wait to see what happens when I get this turned on.

Title: Re: Recent posts user preference
Post by: hvyhitter on October 15, 2007, 11:44:33 AM
OMG.. IT WORKS IT WORKS!!!!!!!!

AWESOME.. I will be spreading the word of your AWESOME coding all over..

not only did it install on my heavily modified forum.. it works PERFECTLY.. WOW.. THAT IS SO AWESOME

Thank you Thank You Thank You..

now to the 5 different places I posted for help to say this issue is 100% resolved..

WOOOOOOOOOOT!

Title: Re: Recent posts user preference
Post by: miseryshining on October 15, 2007, 01:46:52 PM
Quote from: hvyhitter on October 15, 2007, 11:39:36 AM
miseryshining! I JUST installed your mod and on my board with 61 modifications it installed with ZERO problems..

WOW.. awesome product.. me not having and install issue is a MIRACLE..

cant wait to see what happens when I get this turned on.


That's nice to know, since it does change quite some files :-) Thanks for the thumbs up!
Title: Re: Recent posts user preference
Post by: zeitwort on October 15, 2007, 02:20:56 PM
I've installed the MOD on a fresh and clean SMF, but the last posts on the index shows the wrong date.

Undefined index: raw_timestamp
Datei: /var/......../smf/Sources/BoardIndex.php


http://smf.zeitwort.at/index.php
Title: Re: Recent posts user preference
Post by: miseryshining on October 15, 2007, 05:17:05 PM
Quote from: zeitwort on October 15, 2007, 02:20:56 PM
I've installed the MOD on a fresh and clean SMF, but the last posts on the index shows the wrong date.

Undefined index: raw_timestamp
Datei: /var/......../smf/Sources/BoardIndex.php


http://smf.zeitwort.at/index.php

Thanks for the report, can you test if it's fixed with the attached package?
Title: Re: v2.3 Instructions
Post by: JaGuR123 on October 15, 2007, 07:09:01 PM
never mind got it working  ;)
Title: Re: Recent posts user preference
Post by: zeitwort on October 16, 2007, 04:20:04 AM
Error message '8: Undefined index: raw_timestamp
File: /var/...../smf/Sources/BoardIndex.php
Line: 417'

8: Undefined index: raw_timestamp
File: /var/..../smf/Sources/BoardIndex.php
Line: 416


And the date is January 01, 1970, 01:00:00 am
Title: Re: Recent posts user preference
Post by: miseryshining on October 16, 2007, 04:32:10 AM
Quote from: zeitwort on October 16, 2007, 04:20:04 AM
Error message '8: Undefined index: raw_timestamp
File: /var/...../smf/Sources/BoardIndex.php
Line: 417'

8: Undefined index: raw_timestamp
File: /var/..../smf/Sources/BoardIndex.php
Line: 416


And the date is January 01, 1970, 01:00:00 am

can you attach your BoardIndex.php file?
Title: Re: Recent posts user preference
Post by: zeitwort on October 16, 2007, 04:38:22 AM
Of course

Something else: When I use the paketparser with your Mod, I get a lot oft errors!

http://parser.smfportal.de/

Debugging-Informationen
Fehler: String could not be parsed as XML
Datei: /var/www/sk02310/html/smfport/parser/index.php:139
Es tauchen Fehler beim Parsen der XML-Datei auf:

Verlauf des Fehlers:
#0 /var/www/sk02310/html/smfport/parser/index.php(139): SimpleXMLElement->__construct('')
#1 /var/www/sk02310/html/smfport/parser/index.php(100): parsePackageInfoXML('/var/www/sk0231...', 'install', 'all')
#2 /var/www/sk02310/html/smfport/parser/index.php(741): parseArchive()
#3 {main}
Title: Re: Recent posts user preference
Post by: miseryshining on October 16, 2007, 05:38:30 AM
Quote from: zeitwort on October 16, 2007, 04:38:22 AM
Of course

Something else: When I use the paketparser with your Mod, I get a lot oft errors!

http://parser.smfportal.de/

Debugging-Informationen
Fehler: String could not be parsed as XML
Datei: /var/www/sk02310/html/smfport/parser/index.php:139
Es tauchen Fehler beim Parsen der XML-Datei auf:

Verlauf des Fehlers:
#0 /var/www/sk02310/html/smfport/parser/index.php(139): SimpleXMLElement->__construct('')
#1 /var/www/sk02310/html/smfport/parser/index.php(100): parsePackageInfoXML('/var/www/sk0231...', 'install', 'all')
#2 /var/www/sk02310/html/smfport/parser/index.php(741): parseArchive()
#3 {main}


Yup, probably has to do with me not adding all <|[CDATA[ ]]> in there. Doesn't make installation fail anyway.

BoardIndex.php is ok, can you attach your SSI.php as well?
Title: Re: Recent posts user preference
Post by: zeitwort on October 16, 2007, 05:46:07 AM
I made this testforum for this Mod. Everything ist original.
Title: Re: Recent posts user preference
Post by: miseryshining on October 16, 2007, 05:52:06 AM
Quote from: zeitwort on October 16, 2007, 05:46:07 AM
I made this testforum for this Mod. Everything ist original.

seems you didnt install the updated package yet which i attached above:
http://www.simplemachines.org/community/index.php?topic=158917.msg1274962#msg1274962

It should fix this. You'll have to uninstall the old package, and delete it as well, then download the new one and install it.
Title: Re: Recent posts user preference
Post by: zeitwort on October 16, 2007, 05:55:04 AM
Certainly, but I will delete everything and install again

Title: Re: Recent posts user preference
Post by: miseryshining on October 16, 2007, 05:55:59 AM
Quote from: zeitwort on October 16, 2007, 05:55:04 AM
Certainly, but I will delete everything and install again



Ok, seems there is an error in the installer after all, fixing it now.
Title: Re: Recent posts user preference
Post by: zeitwort on October 16, 2007, 06:06:05 AM
So, I tried it with a new blank SMF, but everything is the same.  Wrong date and errors.
Title: Re: Recent posts user preference
Post by: miseryshining on October 16, 2007, 06:16:01 AM
Quote from: zeitwort on October 16, 2007, 06:06:05 AM
So, I tried it with a new blank SMF, but everything is the same.  Wrong date and errors.

yes, somehow the installer didnt change something, without giving any errors. this attached package should do the trick.
Title: Re: Recent posts user preference
Post by: zeitwort on October 16, 2007, 06:31:30 AM
Yes! Thank you - now the date is correct and there are no errors!

Quote from: miseryshining on March 19, 2007, 05:37:32 PM

require_once('SSI.php');
if (function_exists('ssi_recentPostsPref')) ssi_recentPostsPref();

Can you give me one example how to use this? My schoolenglish ist not able to make me understanding this!
Title: Re: Recent posts user preference
Post by: miseryshining on October 16, 2007, 06:42:18 AM
Quote from: zeitwort on October 16, 2007, 06:31:30 AM
Yes! Thank you - now the date is correct and there are no errors!

Quote from: miseryshining on March 19, 2007, 05:37:32 PM

require_once('SSI.php');
if (function_exists('ssi_recentPostsPref')) ssi_recentPostsPref();

Can you give me one example how to use this? My schoolenglish ist not able to make me understanding this!

Thanks for helping me solve that ^^. There are some examples of use in this topic. You need to edit your index.template.php, or one of the other template files. It takes some understanding of PHP though.


require_once('SSI.php');
if (function_exists['ssi_recentPostsPref']) {
echo '  <div class="recentposts">';
  ssi_recentPostsPref();
echo '  </div>';


You can then style it from the theme settings in your administration panel (style.css) and add a border, etc.

.recentposts { border: 1px solid #000000; }
Title: Re: Recent posts user preference
Post by: zeitwort on October 16, 2007, 07:02:10 AM
Thank you, now I can understand the background!

I've translated the MOD to german - maybe you want include this!
/Themes/default/languages/Profile.german.php
$txt['RP_title'] = 'Aktive Postings Einstellungen';
$txt['RP_info'] = 'Hier kannst du den Aktive Postings Block einstellen';
$txt['RP_blockSettings'] = 'Einstellungen für Blöcke';
$txt['RP_lastOnly'] = 'Themenansicht (Nur die letzen Antworten eines Themas)';
$txt['RP_nrofPosts'] = 'Anzahl der Beiträge';
$txt['RP_recentPosts'] = $txt['recentPosts'] = 'Aktive Postings Einstellungen';
$txt['RP_listheader'] = 'Wähle die anzuzeigenden Foren';

/Themes/default/languages/ModSettings.german.php
$txt['userprefs_title'] = 'Benutzereinstellungen';
$txt['userprefsMode'] = 'Extra Benutzereinstellungen für aktive Postings erlauben';

/Themes/default/languages/index.german.php
$txt['recent_topics'] = 'Aktive Themen';
$txt['unread_topics_only'] = 'Zeige nur Ungelesene';
Title: Re: Recent posts user preference
Post by: JaGuR123 on October 16, 2007, 07:30:29 AM
Quote from: miseryshining on October 14, 2007, 12:32:02 AMSyntax:
ssi_recentPostsPref( int $nrofPosts, string $boards, string $returnMode, int $mode, int $member_id )

$nrofPosts:     

    * override user preference,
    * default: null

$boards:           

    * override board selection
    * possible values: board numbers separated by commas
    * default: null

$returnMode:

    * how the list is returned
    * possible values:       

------  'echo' (print the result on the page)
------  'extended' (creates a detailed array with recent topics, ala vBulletin. puts it in $context['topics'])
------  [anything else] (return an array with post/topic info)

    * default: 'echo'
    * peculiarities:  applies only for recent topics, for recent posts, it will fallback to 'echo' mode

$mode:           

    * override posts/topics mode
    * possible values:

------  1 (show all posts)
------  2 (show topics)

    * default: 1                     

$member_id   

    * show only posts by one member
    * default: null


So lets see if i have this correct we replace the strings with values inside the function ?

for eg

if you want to display it for member 2 you put 2 where $member_id is ?

ssi_recentPostsPref( int $nrofPosts, string $boards, string $returnMode, int $mode, 2)

Correct ?  :-\

Cheers

edit:

Also with this little gem you gave me before

ssi_recentPosts($context['user']['recentPosts']['nrofPosts'], null, 'echo', null, $context['user']['id']);

i have it displaying all the user posts in profile.template.php of the users profile you are looking at and it is great, but one little problem i have with it is, that if that user has posted in same topic more then once then that topic shows up more then once , is it possible to only show the topic once for multiple posts and when clicked on go to the last post of that user ?

It's just a small grievance i have with it and not of great importance  :D

Thanks great work
Title: Re: Recent posts user preference
Post by: zeitwort on October 16, 2007, 04:39:26 PM
There are new errors!

8: Undefined index:  action
Datei: /var/...../smf/SSI.php
Zeile: 398

8: Undefined variable:  extravalues
Datei: /var/kunden/zeitwort/smf/SSI.php
Zeile: 378


Here my SSI.php


{$extravalues}
                        m.posterTime, ms.subject, m.ID_TOPIC, m.ID_MEMBER, m.ID_MSG, b.ID_BOARD, b.name AS bName,
                        IFNULL(mem.realName, m.posterName) AS posterName, " . ($user_info['is_guest'] ? '1 AS isRead, 0 AS new_from' : '
                        IFNULL(lt.ID_MSG, IFNULL(lmr.ID_MSG, 0)) >= m.ID_MSG_MODIFIED AS isRead,
                        IFNULL(lt.ID_MSG, IFNULL(lmr.ID_MSG, -1)) + 1 AS new_from') . ", LEFT(m.body, 384) AS body, m.smileysEnabled, m.icon
                FROM ({$db_prefix}messages AS m, {$db_prefix}topics AS t, {$db_prefix}boards AS b, {$db_prefix}messages AS ms)
                        LEFT JOIN {$db_prefix}members AS mem ON (mem.ID_MEMBER = m.ID_MEMBER)" . (!$user_info['is_guest'] ? "
                        LEFT JOIN {$db_prefix}log_topics AS lt ON (lt.ID_TOPIC = t.ID_TOPIC AND lt.ID_MEMBER = $ID_MEMBER)
                        LEFT JOIN {$db_prefix}log_mark_read AS lmr ON (lmr.ID_BOARD = b.ID_BOARD AND lmr.ID_MEMBER = $ID_MEMBER)" : '') . "
                WHERE t.ID_LAST_MSG >= " . ($modSettings['maxMsgID'] - 35 * min($num_recent, 5)) . "
                        AND t.ID_LAST_MSG = m.ID_MSG
                        AND b.ID_BOARD = t.ID_BOARD" . (empty($exclude_boards) ? '' : "
                        AND b.ID_BOARD NOT IN (" . implode(', ', $exclude_boards) . ")") . (!empty($include_boards) ? "
                        AND b.ID_BOARD IN (" . implode(', ', $include_boards) . ")"  : '') . (isset($_REQUEST['limit']) && is_numeric($_REQUEST['limit']) ? "
                        AND m.posterTime > " . (time() - ($_REQUEST['limit']*24*60*60)) : '') . (!empty($member_id) ? "       
                        AND m.ID_MEMBER = {$member_id}" : '') .        "
                        AND $user_info[query_see_board]
                        AND ms.ID_MSG = t.ID_FIRST_MSG
                ORDER BY " . (isset($_REQUEST['sort']) ? (
                        $_REQUEST['sort'] . ($context['ascending'] ? '' : ' DESC')) : ("t.ID_LAST_MSG DESC")) . "
                LIMIT " . ((isset($_REQUEST['start']) && $_REQUEST['action'] == 'recenttopics' && is_numeric($_REQUEST['start'])) ? ($_REQUEST['start'].', ') : ('')) . $num_recent, __FILE__, __LINE__);


Title: Re: Recent posts user preference
Post by: miseryshining on October 16, 2007, 04:59:20 PM
Quote from: JaGuR123 on October 16, 2007, 07:30:29 AM
Quote from: miseryshining on October 14, 2007, 12:32:02 AMSyntax:
ssi_recentPostsPref( int $nrofPosts, string $boards, string $returnMode, int $mode, int $member_id )

$nrofPosts:     

    * override user preference,
    * default: null

$boards:           

    * override board selection
    * possible values: board numbers separated by commas
    * default: null

$returnMode:

    * how the list is returned
    * possible values:       

------  'echo' (print the result on the page)
------  'extended' (creates a detailed array with recent topics, ala vBulletin. puts it in $context['topics'])
------  [anything else] (return an array with post/topic info)

    * default: 'echo'
    * peculiarities:  applies only for recent topics, for recent posts, it will fallback to 'echo' mode

$mode:           

    * override posts/topics mode
    * possible values:

------  1 (show all posts)
------  2 (show topics)

    * default: 1                     

$member_id   

    * show only posts by one member
    * default: null


So lets see if i have this correct we replace the strings with values inside the function ?

for eg

if you want to display it for member 2 you put 2 where $member_id is ?

ssi_recentPostsPref( int $nrofPosts, string $boards, string $returnMode, int $mode, 2)

Correct ?  :-\
you should use this:

ssi_recentPostsPref( null, null, 'echo', null, 2)

QuoteAlso with this little gem you gave me before

ssi_recentPosts($context['user']['recentPosts']['nrofPosts'], null, 'echo', null, $context['user']['id']);

i have it displaying all the user posts in profile.template.php of the users profile you are looking at and it is great, but one little problem i have with it is, that if that user has posted in same topic more then once then that topic shows up more then once , is it possible to only show the topic once for multiple posts and when clicked on go to the last post of that user ?

It's just a small grievance i have with it and not of great importance  :D

Thanks great work

Change it to the code above ;-) Users can then select themselves what mode they want to use
Title: Re: Recent posts user preference
Post by: miseryshining on October 16, 2007, 05:01:08 PM
Quote from: zeitwort on October 16, 2007, 04:39:26 PM
There are new errors!

8: Undefined index:  action
Datei: /var/...../smf/SSI.php
Zeile: 398

8: Undefined variable:  extravalues
Datei: /var/kunden/zeitwort/smf/SSI.php
Zeile: 378


Here my SSI.php


{$extravalues}
                        m.posterTime, ms.subject, m.ID_TOPIC, m.ID_MEMBER, m.ID_MSG, b.ID_BOARD, b.name AS bName,
                        IFNULL(mem.realName, m.posterName) AS posterName, " . ($user_info['is_guest'] ? '1 AS isRead, 0 AS new_from' : '
                        IFNULL(lt.ID_MSG, IFNULL(lmr.ID_MSG, 0)) >= m.ID_MSG_MODIFIED AS isRead,
                        IFNULL(lt.ID_MSG, IFNULL(lmr.ID_MSG, -1)) + 1 AS new_from') . ", LEFT(m.body, 384) AS body, m.smileysEnabled, m.icon
                FROM ({$db_prefix}messages AS m, {$db_prefix}topics AS t, {$db_prefix}boards AS b, {$db_prefix}messages AS ms)
                        LEFT JOIN {$db_prefix}members AS mem ON (mem.ID_MEMBER = m.ID_MEMBER)" . (!$user_info['is_guest'] ? "
                        LEFT JOIN {$db_prefix}log_topics AS lt ON (lt.ID_TOPIC = t.ID_TOPIC AND lt.ID_MEMBER = $ID_MEMBER)
                        LEFT JOIN {$db_prefix}log_mark_read AS lmr ON (lmr.ID_BOARD = b.ID_BOARD AND lmr.ID_MEMBER = $ID_MEMBER)" : '') . "
                WHERE t.ID_LAST_MSG >= " . ($modSettings['maxMsgID'] - 35 * min($num_recent, 5)) . "
                        AND t.ID_LAST_MSG = m.ID_MSG
                        AND b.ID_BOARD = t.ID_BOARD" . (empty($exclude_boards) ? '' : "
                        AND b.ID_BOARD NOT IN (" . implode(', ', $exclude_boards) . ")") . (!empty($include_boards) ? "
                        AND b.ID_BOARD IN (" . implode(', ', $include_boards) . ")"  : '') . (isset($_REQUEST['limit']) && is_numeric($_REQUEST['limit']) ? "
                        AND m.posterTime > " . (time() - ($_REQUEST['limit']*24*60*60)) : '') . (!empty($member_id) ? "       
                        AND m.ID_MEMBER = {$member_id}" : '') .        "
                        AND $user_info[query_see_board]
                        AND ms.ID_MSG = t.ID_FIRST_MSG
                ORDER BY " . (isset($_REQUEST['sort']) ? (
                        $_REQUEST['sort'] . ($context['ascending'] ? '' : ' DESC')) : ("t.ID_LAST_MSG DESC")) . "
                LIMIT " . ((isset($_REQUEST['start']) && $_REQUEST['action'] == 'recenttopics' && is_numeric($_REQUEST['start'])) ? ($_REQUEST['start'].', ') : ('')) . $num_recent, __FILE__, __LINE__);




I'll fix that later (curretnly converting to new installation format), it's nothing to worry about. I didn't know SMF would log all of these, it's really nothing critical ;-)
Title: Re: Recent posts user preference
Post by: NEMINI on October 17, 2007, 08:09:04 AM
bit of an odd issue.  Installs fine.  Works fine except if a user chooses the Topic view (Only show the last reply of a thread) option and tries to enter a forum an internal server error occurs.  turn off the topic view option and everything works great again.
Title: Re: Recent posts user preference
Post by: miseryshining on October 17, 2007, 09:58:39 AM
Quote from: NEMINI on October 17, 2007, 08:09:04 AM
bit of an odd issue.  Installs fine.  Works fine except if a user chooses the Topic view (Only show the last reply of a thread) option and tries to enter a forum an internal server error occurs.  turn off the topic view option and everything works great again.

it happens only when they visit a forum, not on the board index? I can't seem to reproduce it, can you show me the error?? Inside forums it shouldn't load this mod.
Title: Re: Recent posts user preference
Post by: zeitwort on October 17, 2007, 11:28:16 AM
In my forum is the same. If the user chooses "Topic view (Only show the last reply of a thread)", then are error messages.

8: Undefined index:  action
Datei: /var/........../smf/SSI.php
Zeile: 398

8: Undefined variable:  extravalues
Datei: /var/........./smf/SSI.php
Zeile: 378



Title: Re: Recent posts user preference
Post by: miseryshining on October 17, 2007, 11:38:36 AM
Quote from: zeitwort on October 17, 2007, 11:28:16 AM
In my forum is the same. If the user chooses "Topic view (Only show the last reply of a thread)", then are error messages.

8: Undefined index:  action
Datei: /var/........../smf/SSI.php
Zeile: 398

8: Undefined variable:  extravalues
Datei: /var/........./smf/SSI.php
Zeile: 378


thanks for the reports :-). I will fix all of these 'errors' soon. But you didnt get the internal server error, right?
Title: Re: Recent posts user preference
Post by: zeitwort on October 17, 2007, 11:50:44 AM
Quote from: miseryshining on October 17, 2007, 11:38:36 AM
thanks for the reports :-). I will fix all of these 'errors' soon. But you didnt get the internal server error, right?
Certainly these are the errors of the Mod in SMF, but only if any user  has "Topic view (Only show the last reply of a thread)" activated.

Would it be possible to enable this option for guests in the ACP?

Title: Re: Recent posts user preference
Post by: miseryshining on October 17, 2007, 02:37:38 PM
Quote from: zeitwort on October 17, 2007, 11:50:44 AM
Quote from: miseryshining on October 17, 2007, 11:38:36 AM
thanks for the reports :-). I will fix all of these 'errors' soon. But you didnt get the internal server error, right?
Certainly these are the errors of the Mod in SMF, but only if any user  has "Topic view (Only show the last reply of a thread)" activated.

Would it be possible to enable this option for guests in the ACP?



Only way to do it for guests is with a cookie i think, but isn't it a good reason for guests to register to your forums? So they get all the nice features :-)
Title: Re: Recent posts user preference
Post by: zeitwort on October 17, 2007, 04:58:26 PM
Quote from: miseryshining on October 17, 2007, 02:37:38 PM
Only way to do it for guests is with a cookie i think

I want to change the standard on the board index to "Topic view".
Title: Re: Recent posts user preference
Post by: NEMINI on October 17, 2007, 05:58:58 PM
Quote from: miseryshining on October 17, 2007, 09:58:39 AM
Quote from: NEMINI on October 17, 2007, 08:09:04 AM
bit of an odd issue.  Installs fine.  Works fine except if a user chooses the Topic view (Only show the last reply of a thread) option and tries to enter a forum an internal server error occurs.  turn off the topic view option and everything works great again.

it happens only when they visit a forum, not on the board index? I can't seem to reproduce it, can you show me the error?? Inside forums it shouldn't load this mod.

I've PM'd you a test account so you can experience yourself.  when the topic option is active you cannot access a forum by any means.  Though clicking a specific topic does work. 
Title: Re: Recent posts user preference
Post by: JaGuR123 on October 17, 2007, 06:08:02 PM
Quote from: miseryshining on October 17, 2007, 09:58:39 AM
if a user chooses the Topic view (Only show the last reply of a thread) option and tries to enter a forum an internal server error occurs.  turn off the topic view option and everything works great again.

What is this option supposed to actually do , as i don't think it is working on my forum,  it doesn't make any difference to anything on my forum whether it is checked or not  :(

Also is there a way to get rid of the "re:" in front of the topic subject in recentPosts dispay ?


edit: Never mind , only works in topic/pref blocks , and it fixed everything i was wanting it to fix , i am a little slow , but i get there in the end ;)
Title: Re: Recent posts user preference
Post by: JaGuR123 on October 17, 2007, 07:13:01 PM
I am using it in my profile.template.php and  Changed this code so it defaults to topic view instead of Post view, i also added and renamed the ssi functions to profile.template.php so i could change the display  :D

function ssi_recentPostsPrefb()
{
global $context;
if ($context['user']['recentPosts']['lastOnly'] == 1)
ssi_recentPostsb($context['user']['recentPosts']['nrofPosts'], null, 'echo', $context['user']['recentPosts']['boards']);
else
ssi_recentTopicsb($context['user']['recentPosts']['nrofPosts'], null, 'echo', $context['user']['recentPosts']['boards']);
}


Title: Re: Recent posts user preference
Post by: JaGuR123 on October 17, 2007, 08:33:17 PM
This

ssi_recentPostsPref( null, null, 'echo', null, $context['member']['id']);

and  this

ssi_recentPostsPref( null, null, 'echo', null, 2);

isn't displaying the posts or topics of that user, just keeps displaying the user that is logged in  :(

If i use this it works, by displaying the recent posts of the user's profile i have just clicked on 

ssi_recentPosts($context['user']['recentPosts']['nrofPosts'], null, 'echo', null, $context['member']['id']);

but if i try to just get the topic display using this

ssi_recentTopics($context['user']['recentPosts']['nrofPosts'], null, 'echo', null, $context['member']['id']);

it doesn't work either

I would just love to have the ssi_recentTopics to only display the $context['member']['id'] for the user that i clicked profile for

:'(
Title: Re: Recent posts user preference
Post by: miseryshining on October 18, 2007, 09:05:11 AM
JaGuR123, i think you should use the function like this if you want to display it in the profiles template:

ssi_recentPostsPref(5,null,'echo',null,(int) isset($_REQUEST['u']) ? $_REQUEST['u'] : null );

this will display the last 5 posts OR topics (depending on the user's preference). you can change it to display only topics like this:

ssi_recentPostsPref(5,null,'echo',2,(int) isset($_REQUEST['u']) ? $_REQUEST['u'] : null );

as you can see there is no need anymore to use the other functions :-)

@zeitwort: I'm going to release a new version with a setting to display topics by default.

@NEMINI: I just can't figure out what it is. Please uninstall the mod and call ssi_recentTopics(); in your index.template instead, to find out if the same thing happens.

edit An update is released which fixes the error messages and adds a new setting for the boardindex. For now it's only the English version because I can't use the new package format yet which allows for translations.
Title: Re: Recent posts user preference
Post by: zeitwort on October 18, 2007, 06:31:16 PM
8: Undefined index: showing_all_topics
File: /var/..../smf/Themes/default/Recent.template.php (eval?)
Line: 176

8: Undefined index: showing_all_topics
File: /var/..../smf/Themes/default/Recent.template.php (eval?)
Line: 135

8: Undefined index: showing_all_topics
File: /var/..../smf/Themes/default/Recent.template.php (eval?)
Line: 133

8: Undefined index: showing_all_topics
File: /var/..../smf/Themes/default/Recent.template.php (eval?)
Line: 131

8: Undefined index: showing_all_topics
File: /var/..../smf/Themes/default/Recent.template.php (eval?)
Line: 129

8: Undefined index: showing_all_topics
File: /var/..../smf/Themes/default/Recent.template.php (eval?)
Line: 127


This is from a fresh installation!

I have no choice in the ACP - only "Use recent topics mode instead on board index" in "Themes and Settings".
Title: Re: Recent posts user preference
Post by: NEMINI on October 19, 2007, 01:25:07 AM
Quote from: miseryshining on October 18, 2007, 09:05:11 AM
@NEMINI: I just can't figure out what it is. Please uninstall the mod and call ssi_recentTopics(); in your index.template instead, to find out if the same thing happens.

Okay tried that.  worked fine.  Then i redownloaded the latest version (did you make changes and not change version numbers? confused by your  update announcement) and reinstalled it.  Now with the topic option under profile checked I no longer get an internal server error however it does attempt to load the entire website in the block rather then just go to the forum.  That probably doesn't make sense so you can either try it yourself still with that test account or maybe this screenshot will help.

(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fnemini.org%2Fstuff%2Fwtf.png&hash=239c16747d94036cb59fdc5d8cbd6aec47891503)
Title: Re: Recent posts user preference
Post by: miseryshining on October 19, 2007, 04:44:51 AM
Quote from: zeitwort on October 18, 2007, 06:31:16 PM
8: Undefined index: showing_all_topics
File: /var/..../smf/Themes/default/Recent.template.php (eval?)
Line: 176

8: Undefined index: showing_all_topics
File: /var/..../smf/Themes/default/Recent.template.php (eval?)
Line: 135

8: Undefined index: showing_all_topics
File: /var/..../smf/Themes/default/Recent.template.php (eval?)
Line: 133

8: Undefined index: showing_all_topics
File: /var/..../smf/Themes/default/Recent.template.php (eval?)
Line: 131

8: Undefined index: showing_all_topics
File: /var/..../smf/Themes/default/Recent.template.php (eval?)
Line: 129

8: Undefined index: showing_all_topics
File: /var/..../smf/Themes/default/Recent.template.php (eval?)
Line: 127


This is from a fresh installation!

I have no choice in the ACP - only "Use recent topics mode instead on board index" in "Themes and Settings".

Yep, i added the option only to the theme settings. It wouldn't make sense adding it anywhere else since you would have to edit files manually anyway to add the ssi_recentPostsPref() function. The index errors are fixed once again, redownload the package please :-)

Quote from: NEMINI on October 19, 2007, 01:25:07 AM
Quote from: miseryshining on October 18, 2007, 09:05:11 AM
@NEMINI: I just can't figure out what it is. Please uninstall the mod and call ssi_recentTopics(); in your index.template instead, to find out if the same thing happens.

Okay tried that.  worked fine.  Then i redownloaded the latest version (did you make changes and not change version numbers? confused by your  update announcement) and reinstalled it.  Now with the topic option under profile checked I no longer get an internal server error however it does attempt to load the entire website in the block rather then just go to the forum.  That probably doesn't make sense so you can either try it yourself still with that test account or maybe this screenshot will help.

(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fnemini.org%2Fstuff%2Fwtf.png&hash=239c16747d94036cb59fdc5d8cbd6aec47891503)

Works like it should for me now (also for anonymous users)... I didn't change anything in the package that would cause it to act different though.

About update policy: I only up the version number when new features are added or when big changes are made. For small bug fixes i will just overwrite the current version.
Title: Re: Recent posts user preference
Post by: NEMINI on October 19, 2007, 06:01:23 AM
still not working for me.  even logged in as the test user.  test user did not have the topic view option checked though when i first logged in as it so i checked it and then it stopped working.
Title: Re: Recent posts user preference
Post by: miseryshining on October 19, 2007, 06:07:04 AM
Quote from: NEMINI on October 19, 2007, 06:01:23 AM
still not working for me.  even logged in as the test user.  test user did not have the topic view option checked though when i first logged in as it so i checked it and then it stopped working.

ai, must have overlooked that. will look into it more this weekend.
Title: Re: Recent posts user preference
Post by: NEMINI on October 19, 2007, 06:09:50 AM
thank you for your help so far and sorry to be such a pain
Title: Re: Recent posts user preference
Post by: miseryshining on October 19, 2007, 07:34:49 AM
Quote from: NEMINI on October 19, 2007, 06:09:50 AM
thank you for your help so far and sorry to be such a pain

This mod evolved into something it wasn't originally intended to be, and I must admit that i hacked in some of the features without proper knowledge of parts of SMF ;-).

Anyways, i think i got your problem fixed, please test the attached package :-)
Title: Re: Recent posts user preference
Post by: waz on October 19, 2007, 05:57:10 PM
I keep getting this error when I try and use 'Current Theme or Themes and Layout' on the admin menu.

Every thing else works OK.

If I uninstall the MOD it works OK.

QuoteTemplate Parse Error!
There was a problem loading the /Themes/default/languages/Themes.english.php template or language file. Please check the syntax and try again - remember, single quotes (') often have to be escaped with a slash (\). To see more specific error information from PHP, try accessing the file directly.

You may want to try to refresh this page or use the default theme.

Parse error: syntax error, unexpected T_STRING in .../Themes/default/languages/Themes.english.php on line 140

131: $txt['themeadmin_edit_modified'] = 'Last Modified';
132: $txt['themeadmin_edit_size'] = 'Size';
133: $txt['themeadmin_edit_bytes'] = 'B';
134: $txt['themeadmin_edit_kilobytes'] = 'KB';
135: $txt['themeadmin_edit_error'] = 'The file you tried to save generated the following error:';
136: $txt['themeadmin_edit_on_line'] = 'Beginning on line';
137: $txt['themeadmin_edit_preview'] = 'Preview';
138:
139: $txt['RP_mode_recent'] = 'Use recent topics mode instead on board index';

140: $txt['RP_mode_recent_desc'] = 'Will show recent topics instead of posts for members that haven't set up their preferences and for guests.';

141: ?>
142:
143:
Title: Re: Recent posts user preference
Post by: miseryshining on October 19, 2007, 06:25:42 PM
Quote from: waz on October 19, 2007, 05:57:10 PM
I keep getting this error when I try and use 'Current Theme or Themes and Layout' on the admin menu.

Every thing else works OK.

If I uninstall the MOD it works OK.

QuoteTemplate Parse Error!
There was a problem loading the /Themes/default/languages/Themes.english.php template or language file. Please check the syntax and try again - remember, single quotes (') often have to be escaped with a slash (\). To see more specific error information from PHP, try accessing the file directly.

You may want to try to refresh this page or use the default theme.

Parse error: syntax error, unexpected T_STRING in .../Themes/default/languages/Themes.english.php on line 140

131: $txt['themeadmin_edit_modified'] = 'Last Modified';
132: $txt['themeadmin_edit_size'] = 'Size';
133: $txt['themeadmin_edit_bytes'] = 'B';
134: $txt['themeadmin_edit_kilobytes'] = 'KB';
135: $txt['themeadmin_edit_error'] = 'The file you tried to save generated the following error:';
136: $txt['themeadmin_edit_on_line'] = 'Beginning on line';
137: $txt['themeadmin_edit_preview'] = 'Preview';
138:
139: $txt['RP_mode_recent'] = 'Use recent topics mode instead on board index';

140: $txt['RP_mode_recent_desc'] = 'Will show recent topics instead of posts for members that haven't set up their preferences and for guests.';

141: ?>
142:
143:

Ups, fixed now. Damn, I'm just terrible! Please re-download the latest version.
Title: Re: Recent posts user preference
Post by: waz on October 19, 2007, 06:45:20 PM
It works

Thanks for get working so Quickly

Quote from: miseryshining on October 19, 2007, 06:25:42 PM
Quote from: waz on October 19, 2007, 05:57:10 PM
I keep getting this error when I try and use 'Current Theme or Themes and Layout' on the admin menu.

Every thing else works OK.

If I uninstall the MOD it works OK.

QuoteTemplate Parse Error!
There was a problem loading the /Themes/default/languages/Themes.english.php template or language file. Please check the syntax and try again - remember, single quotes (') often have to be escaped with a slash (\). To see more specific error information from PHP, try accessing the file directly.

You may want to try to refresh this page or use the default theme.

Parse error: syntax error, unexpected T_STRING in .../Themes/default/languages/Themes.english.php on line 140

131: $txt['themeadmin_edit_modified'] = 'Last Modified';
132: $txt['themeadmin_edit_size'] = 'Size';
133: $txt['themeadmin_edit_bytes'] = 'B';
134: $txt['themeadmin_edit_kilobytes'] = 'KB';
135: $txt['themeadmin_edit_error'] = 'The file you tried to save generated the following error:';
136: $txt['themeadmin_edit_on_line'] = 'Beginning on line';
137: $txt['themeadmin_edit_preview'] = 'Preview';
138:
139: $txt['RP_mode_recent'] = 'Use recent topics mode instead on board index';

140: $txt['RP_mode_recent_desc'] = 'Will show recent topics instead of posts for members that haven't set up their preferences and for guests.';

141: ?>
142:
143:

Ups, fixed now. Damn, I'm just terrible! Please re-download the latest version.
Title: Re: Recent posts user preference
Post by: NEMINI on October 19, 2007, 07:48:57 PM
it works now.  YEAH!  thank you so much for a wonderful mod.
Title: Re: Recent posts user preference
Post by: Jade Elizabeth on October 23, 2007, 09:26:38 PM
this is perfect, but after i installed it my colours for the recent threads list vanished
http://custom.simplemachines.org/mods/index.php?mod=111  <an attribute of that mod

how do i get them back?
Title: Re: Recent posts user preference
Post by: miseryshining on October 24, 2007, 05:15:21 AM
Quote from: Alundra on October 23, 2007, 09:26:38 PM
this is perfect, but after i installed it my colours for the recent threads list vanished
http://custom.simplemachines.org/mods/index.php?mod=111  <an attribute of that mod

how do i get them back?

edit BoardIndex.php in the Sources dir.

change:
require_once('SSI.php');

with:
require_once($sourcedir . '/Recent.php');

and
ssi_recentPostsPref(
isset($context['user']['recentPosts']['nrofPosts']) && $modSettings['userprefsMode'] == 1 ? null : $settings['number_recent_posts'],
null,
'array',
$context['user']['recentPosts']['lastOnly'] != 'NULL' ? $context['user']['recentPosts']['lastOnly'] : (
isset($settings['mode_recent']) && $settings['mode_recent'] == 1 ? '2' : null),
null
);


with:
getLastPosts($settings['number_recent_posts'])

This will ignore all preferences though. 
Title: Re: Recent posts user preference
Post by: Jade Elizabeth on October 24, 2007, 07:30:19 AM
thanks!
works
all good
:D
Title: Re: Recent posts user preference
Post by: ES23 on November 10, 2007, 01:37:12 AM
Hi!

I've just download the recent-posts user preference package v2.3 today and installed in another of my fresh new forum but I got the below errors:

http://www.XXXXXX.com/forums/index.php?action=admin
8: Use of undefined constant recent_topics - assumed 'recent_topics'
File: /var/www/html/forums/Themes/default/Admin.template.php (main_above sub template - eval?)
Line: 568


http://www.XXXXXX.com/forums/index.php?action=viewErrorLog;desc
8: Use of undefined constant recent_topics - assumed 'recent_topics'
File: /var/www/html/forums/Themes/default/Errors.template.php (main_above sub template - eval?)
Line: 568

How can I resolve this error?All tests are successful for this mod and I've installed it successfully.
Title: Re: Recent posts user preference
Post by: miseryshining on November 12, 2007, 04:31:54 AM
Quote from: ES23 on November 10, 2007, 01:37:12 AM
Hi!

I've just download the recent-posts user preference package v2.3 today and installed in another of my fresh new forum but I got the below errors:

http://www.XXXXXX.com/forums/index.php?action=admin
8: Use of undefined constant recent_topics - assumed 'recent_topics'
File: /var/www/html/forums/Themes/default/Admin.template.php (main_above sub template - eval?)
Line: 568


http://www.XXXXXX.com/forums/index.php?action=viewErrorLog;desc
8: Use of undefined constant recent_topics - assumed 'recent_topics'
File: /var/www/html/forums/Themes/default/Errors.template.php (main_above sub template - eval?)
Line: 568

How can I resolve this error?All tests are successful for this mod and I've installed it successfully.

Can't reproduce these. these files aren't changed by this mod. did it happen just once, or more then once?
Title: Re: Recent posts user preference
Post by: ES23 on November 12, 2007, 05:16:54 AM
As of now,I don't see those above errors appearing again .... :)

But now,this error is repetitive:

http://www.XXXXXX.com/forums/index.php?action=profile;u=1;sa=recentPosts
8: Undefined index: userprefsMode
File: /var/www/html/forums/Themes/default/languages/Settings.english.php (recentPosts sub template - eval?)
Line: 1893

How can I solve this?Kindly please advise :) and I realised the recent topics/posts don't seem to work according to user preferences ... Despite me not choosing to display topics from a particular board under recent posts preferences,when I access recent posts or recent topics,they still display ...

This is my Settings.english file:

<?php
// Version: 1.1; Settings

$txt['theme_thumbnail_href'] = $settings['images_url'] . '/thumbnail.gif';
$txt['theme_description'] = 'The default theme from Simple Machines.<br /><br />Thanks go to Bloc and the design team.';

?>


As you can see,there's no userprefsMode at all ... so strange ... :(
Title: Re: Recent posts user preference
Post by: ES23 on November 12, 2007, 05:45:16 AM
The error has stop producing ... :)

But the function still fails to work ... ... it can work on my another mod-packed forum but not on this fresh new forum.I created a tab for recent topics(www.XXXXXX.com/forums/index.php?action=recenttopics) and have set my board preferences under Recent posts preferences in my profile.But the display for recent topics don't follow my recent posts preferences at all.Neither does the recent posts follow as well ... :(
Title: Re: Recent posts user preference
Post by: miseryshining on November 12, 2007, 06:08:49 AM
Quote from: ES23 on November 12, 2007, 05:45:16 AM
The error has stop producing ... :)

But the function still fails to work ... ... it can work on my another mod-packed forum but not on this fresh new forum.I created a tab for recent topics(www.XXXXXX.com/forums/index.php?action=recenttopics) and have set my board preferences under Recent posts preferences in my profile.But the display for recent topics don't follow my recent posts preferences at all.Neither does the recent posts follow as well ... :(

hmmz, seems something went wrong during install. did you try to uninstall / reinstall?
Title: Re: Recent posts user preference
Post by: ES23 on November 12, 2007, 07:37:16 AM
I have tried uninstalling and reinstalling again.

All tests are successful and no more errors produced... but the preferences does not work at all.Which boards the user wish to monitor doesn't seem to have any effect.Recent Topics or Recent posts will just display all recent topics or posts without following the user's selection under recent posts preferences ... :(

I'm really frustrated about this ... can you please kindly advise?I'm running SMF 1.1.4 with Recent posts and topics 2.3 ...
Title: Re: Recent posts user preference
Post by: miseryshining on November 12, 2007, 10:14:29 AM
Quote from: ES23 on November 12, 2007, 07:37:16 AM
I have tried uninstalling and reinstalling again.

All tests are successful and no more errors produced... but the preferences does not work at all.Which boards the user wish to monitor doesn't seem to have any effect.Recent Topics or Recent posts will just display all recent topics or posts without following the user's selection under recent posts preferences ... :(

I'm really frustrated about this ... can you please kindly advise?I'm running SMF 1.1.4 with Recent posts and topics 2.3 ...

i really don't have a clue why it doesnt work for you. you could try to put this on top of your index.template.php to find out if the settings are put into the variables correctly:


global $context;
echo '<pre>';
print_r($context['user']['recentPosts']);
echo '</pre>';


please post the results back here
Title: Re: Recent posts user preference
Post by: ES23 on November 12, 2007, 10:03:02 PM
On top of my index.template.php file?

Ok ...  :o I put it on the very top of my index.template.php file so that now it looks like this:

global $context;
echo '<pre>';
print_r($context['user']['recentPosts']);
echo '</pre>';
<?php
// Version: 1.1; index

/* This template is, perhaps, the most important template in the theme. It
contains the main template layer that displays the header and footer of
the forum, namely with main_above and main_below. It also contains the
menu sub template, which appropriately displays the menu; the init sub
template, which is there to set the theme up; (init can be missing.) and
the linktree sub template, which sorts out the link tree.


After refreshing my forums page,there is this row of code appearing on top of my forum:

global $context; echo '

';
print_r($context['user']['recentPosts']);
echo '

';


No errors are generated in my forum error log.

Please kindly advise me on what is going wrong.Thanks a million :)
Title: Re: Recent posts user preference
Post by: miseryshining on November 13, 2007, 03:24:17 AM
you should put it right beneath the <php tag so it will print some useful info :-)

Title: Re: Recent posts user preference
Post by: ES23 on November 13, 2007, 04:07:27 AM
Lol ... :D Sorry ...

I have put the code after the <?php so now,it looks like this:

<?php
global $context;
echo 
'<pre>';
print_r($context['user']['recentPosts']);
echo 
'</pre>';
// Version: 1.1; index

/* This template is,


A new row of code appear on top of my forum page.It is as shown below:
Array
(
    [boards] => Array
        (
        )

    [lastOnly] => NULL
    [nrofPosts] => 10
)



I realised the set of code that appears on top of my forum differs when I stayed log-in or not.The above shown code that appear is before I logged in.After I logged in,the row of code that appears on top of my forum page becomes:
Array
(
    [boards] => Array
        (
        )

    [lastOnly] => 1
    [nrofPosts] => 25
)



No errors are generated in the forum error log in anyway :)

So any suggestion to solve this? :( Please advise.
Title: Re: Recent posts user preference
Post by: miseryshining on November 13, 2007, 08:46:42 AM
so, it seems you haven't selected any boards to monitor in your profile, is that right?
Title: Re: Recent posts user preference
Post by: ES23 on November 13, 2007, 09:23:19 AM
That's right :) I did not select any of the boards but yet when I click recent topics(http://www.XXXXXX.com/index.php?action=recenttopics)/recent posts(http://www.XXXXXX.com/index.php?action=recent),the results display ALL the topics/posts from ALL the boards.I did not even select those boards under my profile.My other forum do not seem to have that problem ...

So,what's the reason?Any idea?Please kindly enlighten me on this issue :) Thanks ...

***Here's the row of code that appears on top of my forum page when I'm logged in AND I have chosen a board for display :)

Array
(
    [boards] => Array
        (
            [0] => 1
        )

    [lastOnly] => 1
    [nrofPosts] => 25
)
Title: Re: Recent posts user preference
Post by: miseryshining on November 13, 2007, 09:35:53 AM
Quote from: ES23 on November 13, 2007, 09:23:19 AM
That's right :) I did not select any of the boards but yet when I click recent topics(http://www.XXXXXX.com/index.php?action=recenttopics)/recent posts(http://www.XXXXXX.com/index.php?action=recent),the results display ALL the topics/posts from ALL the boards.I did not even select those boards under my profile.My other forum do not seem to have that problem ...

So,what's the reason?Any idea?Please kindly enlighten me on this issue :) Thanks ...

***Here's the row of code that appears on top of my forum page when I'm logged in AND I have chosen a board for display :)

Array
(
    [boards] => Array
        (
            [0] => 1
        )

    [lastOnly] => 1
    [nrofPosts] => 25
)


I think you're a bit confused about how this is supposed to work. If you don't select any boards at all, it will display ALL of them, no filters applied. you have to select at least one board.. as for the recent posts (action=recent) listing, it isn't affected by this mod.
Title: Re: Recent posts user preference
Post by: Matthew Schenker on November 14, 2007, 11:30:29 AM
In my forum, members have been asking me to increase the number of recent posts from 100 to 500.  But I have not been able to figure out how to do it.

This may be my answer!!

With this mod, is it possible to set the number of recent posts to 500?  Or is there a limit on the number that is possible?

Thanks,
Matt
Title: Re: Recent posts user preference
Post by: miseryshining on November 14, 2007, 02:31:53 PM
Quote from: Matthew Schenker on November 14, 2007, 11:30:29 AM
In my forum, members have been asking me to increase the number of recent posts from 100 to 500.  But I have not been able to figure out how to do it.

This may be my answer!!

With this mod, is it possible to set the number of recent posts to 500?  Or is there a limit on the number that is possible?

Thanks,
Matt

What type of recent posts listing do you mean? the one that is called with action=recent? This mod doesn't change anything about that.
Title: Re: Recent posts user preference
Post by: Matthew Schenker on November 14, 2007, 05:50:33 PM
Quote from: miseryshining on November 14, 2007, 02:31:53 PM
What type of recent posts listing do you mean? the one that is called with action=recent? This mod doesn't change anything about that.

I'm referring to the option that appears in the "Forum Stats" area called "View the most recent posts on the forum."  It usually displays 100 recent messages, and many of my members want to see 500.  I have never found a way to increase the number. I know this modification does not change that area of the forum, but it seems to offer an alternative way for members to see more posts.  That is correct, right?

Thanks,
Matt
Title: Re: Recent posts user preference
Post by: miseryshining on November 14, 2007, 07:18:01 PM
Quote from: Matthew Schenker on November 14, 2007, 05:50:33 PM
Quote from: miseryshining on November 14, 2007, 02:31:53 PM
What type of recent posts listing do you mean? the one that is called with action=recent? This mod doesn't change anything about that.

I'm referring to the option that appears in the "Forum Stats" area called "View the most recent posts on the forum."  It usually displays 100 recent messages, and many of my members want to see 500.  I have never found a way to increase the number. I know this modification does not change that area of the forum, but it seems to offer an alternative way for members to see more posts.  That is correct, right?

Thanks,
Matt
This mod adds the possibility to only show the last post in a topic. maybe that'd be useful.

To answer your question: yes, but the queries will never select more then 125 recent posts to be listed. you'd have to change the queries in SSI.php in the ssi_recentPosts function to fix that. You will also have to change the select values that a user can choose (currently limited to show max 25 posts or topics). The latter you can find in Profile.template.php, in the default theme directory. make backups before editing anything, you wont be able to uninstall the mod if you edit something.  If you need more pointers, just ask.
Title: Re: Recent posts user preference
Post by: JaGuR123 on November 17, 2007, 09:11:11 PM
Hi Miseryshining,

Is there a way to exclude Locked and Stickied Topics ?

I have used this code in Recent.Template.php and MessageIndex.Template.php to do what i want


if (($topic['is_sticky']==0) && ($topic['is_locked']))
{
echo '<td class="windowbg7" valign="middle" align="center" width="4%" style="padding:7px;">&nbsp;
</td>


but i can't get it to work in the ssi.php file, i have tried using different variables like $row['is_locked'] etc , but must be doing it incorrectly  :-[
Title: Re: Recent posts user preference
Post by: miseryshining on November 18, 2007, 10:33:54 AM
Quote from: JaGuR123 on November 17, 2007, 09:11:11 PM
Hi Miseryshining,

Is there a way to exclude Locked and Stickied Topics ?

I have used this code in Recent.Template.php and MessageIndex.Template.php to do what i want


if (($topic['is_sticky']==0) && ($topic['is_locked']))
{
echo '<td class="windowbg7" valign="middle" align="center" width="4%" style="padding:7px;">&nbsp;
</td>


but i can't get it to work in the ssi.php file, i have tried using different variables like $row['is_locked'] etc , but must be doing it incorrectly  :-[

You shouldnt change anything in there probably. do you want to display a list of recent topics (a la action=recent) or are you using a block on your page?
Title: Re: Recent posts user preference
Post by: JaGuR123 on November 18, 2007, 12:25:43 PM
I am using the code copied from ssi.php in a tinyportal php.box

I am displaying recent Topics , but don't want locked topics to show,  if you look here i have made the locked topics un clickable


Jimbo's Tips For Friday (moved to existing thread) (http://www.racehorsetalk.com.au/index.php/board,21.30.html)

I would like to be able to do the same in a php box that displays the last 10 recent replies

Cheers
Title: Re: Recent posts user preference
Post by: miseryshining on November 20, 2007, 06:35:13 AM
Quote from: JaGuR123 on November 18, 2007, 12:25:43 PM
I am using the code copied from ssi.php in a tinyportal php.box

I am displaying recent Topics , but don't want locked topics to show,  if you look here i have made the locked topics un clickable


Jimbo's Tips For Friday (moved to existing thread) (http://www.racehorsetalk.com.au/index.php/board,21.30.html)

I would like to be able to do the same in a php box that displays the last 10 recent replies

Cheers

sorry for the late reply; the queries in SSI.php currently don't check if a topic is locked or sticky. for topics you could quite easily add the functionality to SSI.php BUT this will make it impossible to succesfully uninstall the mod with the package manager (you'd have to remove the changes again before).

look in SSI.php for
// Find all the posts in distinct topics.  Newer ones will have higher IDs.
$request = db_query("
SELECT


change to:

// Find all the posts in distinct topics.  Newer ones will have higher IDs.
$request = db_query("
SELECT t.isSticky AS isSticky2, t.locked AS locked2,


find:

else {
$row['body'] = strip_tags(strtr(parse_bbc($row['body'], $row['smileysEnabled'], $row['ID_MSG']), array('<br />' => '')));
if ($func['strlen']($row['body']) > 128)
$row['body'] = $func['substr']($row['body'], 0, 128) . '...';

// Censor the subject.
censorText($row['subject']);
censorText($row['body']);

if (empty($modSettings['messageIconChecks_disable']) && !isset($icon_sources[$row['icon']]))
$icon_sources[$row['icon']] = file_exists($settings['theme_dir'] . '/images/post/' . $row['icon'] . '.gif') ? 'images_url' : 'default_images_url';

// Build the array.
$posts[] = array(
'board' => array(
'id' => $row['ID_BOARD'],
'name' => $row['bName'],
'href' => $scripturl . '?board=' . $row['ID_BOARD'] . '.0',
'link' => '<a href="' . $scripturl . '?board=' . $row['ID_BOARD'] . '.0">' . $row['bName'] . '</a>'
),
'topic' => $row['ID_TOPIC'],
'poster' => array(
'id' => $row['ID_MEMBER'],
'name' => $row['posterName'],
'href' => empty($row['ID_MEMBER']) ? '' : $scripturl . '?action=profile;u=' . $row['ID_MEMBER'],
'link' => empty($row['ID_MEMBER']) ? $row['posterName'] : '<a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '">' . $row['posterName'] . '</a>'
),
'subject' => $row['subject'],
'short_subject' => shorten_subject($row['subject'], 25),
'preview' => $row['body'],
'time' => timeformat($row['posterTime']),
'timestamp' => forum_time(true, $row['posterTime']),
'raw_timestamp' => $row['posterTime'],
'href' => $scripturl . '?topic=' . $row['ID_TOPIC'] . '.msg' . $row['ID_MSG'] . ';topicseen#new',
'link' => '<a href="' . $scripturl . '?topic=' . $row['ID_TOPIC'] . '.msg' . $row['ID_MSG'] . '#new">' . $row['subject'] . '</a>',
'new' => !empty($row['isRead']),
'new_from' => $row['new_from'],
'icon' => '<img src="' . $settings[$icon_sources[$row['icon']]] . '/post/' . $row['icon'] . '.gif" align="middle" alt="' . $row['icon'] . '" border="0" />',
);
}


and replace with

else {
$row['body'] = strip_tags(strtr(parse_bbc($row['body'], $row['smileysEnabled'], $row['ID_MSG']), array('<br />' => '')));
if ($func['strlen']($row['body']) > 128)
$row['body'] = $func['substr']($row['body'], 0, 128) . '...';

// Censor the subject.
censorText($row['subject']);
censorText($row['body']);

if (empty($modSettings['messageIconChecks_disable']) && !isset($icon_sources[$row['icon']]))
$icon_sources[$row['icon']] = file_exists($settings['theme_dir'] . '/images/post/' . $row['icon'] . '.gif') ? 'images_url' : 'default_images_url';

// Build the array.
$posts[] = array(
'board' => array(
'id' => $row['ID_BOARD'],
'name' => $row['bName'],
'href' => $scripturl . '?board=' . $row['ID_BOARD'] . '.0',
'link' => '<a href="' . $scripturl . '?board=' . $row['ID_BOARD'] . '.0">' . $row['bName'] . '</a>'
),
'topic' => $row['ID_TOPIC'],
'poster' => array(
'id' => $row['ID_MEMBER'],
'name' => $row['posterName'],
'href' => empty($row['ID_MEMBER']) ? '' : $scripturl . '?action=profile;u=' . $row['ID_MEMBER'],
'link' => empty($row['ID_MEMBER']) ? $row['posterName'] : '<a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '">' . $row['posterName'] . '</a>'
),
'is_sticky' => $row['isSticky2'],
'is_locked' => $row['locked2'],
'subject' => $row['subject'],
'short_subject' => shorten_subject($row['subject'], 25),
'preview' => $row['body'],
'time' => timeformat($row['posterTime']),
'timestamp' => forum_time(true, $row['posterTime']),
'raw_timestamp' => $row['posterTime'],
'href' => $scripturl . '?topic=' . $row['ID_TOPIC'] . '.msg' . $row['ID_MSG'] . ';topicseen#new',
'link' => '<a href="' . $scripturl . '?topic=' . $row['ID_TOPIC'] . '.msg' . $row['ID_MSG'] . '#new">' . $row['subject'] . '</a>',
'new' => !empty($row['isRead']),
'new_from' => $row['new_from'],
'icon' => '<img src="' . $settings[$icon_sources[$row['icon']]] . '/post/' . $row['icon'] . '.gif" align="middle" alt="' . $row['icon'] . '" border="0" />',
);
}


under it search for

echo '
<table border="0" class="ssi_table">';
foreach ($posts as $post)
echo '
<tr>
<td align="right" valign="top" nowrap="nowrap">
[', $post['board']['link'], ']
</td>
<td valign="top">
<a href="', $post['href'], '">', $post['subject'], '</a>
', $txt[525], ' ', $post['poster']['link'], '
', $post['new'] ? '' : '<a href="' . $scripturl . '?topic=' . $post['topic'] . '.msg' . $post['new_from'] . ';topicseen#new"><img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/new.gif" alt="' . $txt[302] . '" border="0" /></a>', '
</td>
<td align="right" nowrap="nowrap">
', $post['time'], '
</td>
</tr>';
echo '
</table>';


and replace with

echo '
<table border="0" class="ssi_table">';
foreach ($posts as $post) {
if (($post['is_sticky'] == 0) && ($post['is_locked'] == 0)) {
echo '
<tr>
<td align="right" valign="top" nowrap="nowrap">
[', $post['board']['link'], ']
</td>
<td valign="top">
<a href="', $post['href'], '">', $post['subject'], '</a>
', $txt[525], ' ', $post['poster']['link'], '
', $post['new'] ? '' : '<a href="' . $scripturl . '?topic=' . $post['topic'] . '.msg' . $post['new_from'] . ';topicseen#new"><img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/new.gif" alt="' . $txt[302] . '" border="0" /></a>', '
</td>
<td align="right" nowrap="nowrap">
', $post['time'], '
</td>
</tr>';
}
}
echo '
</table>';


now you can call a recent topics list with:

ssi_recentPostsPref(10, null, 'echo', 2, null)
Title: Re: Recent posts user preference
Post by: Aileen on November 28, 2007, 04:02:57 AM
Nice feature,  BTW is this easy to install on a dilber theme?
Title: Re: Recent posts user preference
Post by: TrueSatan on November 28, 2007, 05:48:40 AM
Similar to your many other queries on other topics...detailed reply given there.
Title: Re: Recent posts user preference
Post by: Aileen on November 28, 2007, 07:00:19 AM
Quote from: TrueSatan on November 28, 2007, 05:48:40 AM
Similar to your many other queries on other topics...detailed reply given there.

I browsed through the mods that is applicable for my site and I ask questions in the right forum
Title: Re: Recent posts user preference
Post by: Jade Elizabeth on November 28, 2007, 08:32:43 AM
you really need to try it for yourself. if its not compatible it will say so. if it doesnt want to install it will say so. then you can ask for help if you cant find the issue previously in the right topic :)
Title: Re: Recent posts user preference
Post by: fizone on November 28, 2007, 08:45:30 AM
Thank you for great job. I'm using SMF and Mambo and want to show my forums recent post in a block (module) at Mambo's first page. Any idea how to do that?

Thanks in advance!
Title: Re: Recent posts user preference
Post by: Jade Elizabeth on November 28, 2007, 09:32:50 AM
start a new topic for that
Title: Re: Recent posts user preference
Post by: fizone on November 28, 2007, 09:39:39 AM
ok sorry. I'll do it.

thanks.
Title: Re: Recent posts user preference
Post by: Aileen on November 29, 2007, 02:51:29 AM
there is an error in index template php in a dilber theme
Title: Re: Recent posts user preference
Post by: miseryshining on November 29, 2007, 06:00:28 AM
Quote from: will888 on November 29, 2007, 02:51:29 AM
there is an error in index template php in a dilber theme

the mod doesnt change anything in the index template file though.. and please post the exact errors from the error log.

Quote from: fizone on November 28, 2007, 08:45:30 AM
Thank you for great job. I'm using SMF and Mambo and want to show my forums recent post in a block (module) at Mambo's first page. Any idea how to do that?

Thanks in advance!

read the first post of this topic. you can use the ssi_recentPostsPref() function to put a block anywhere you want like this:


require_once('SSI.php');
if (function_exists('ssi_recentPostsPref')) ssi_recentPostsPref();


off course you have to point it to the path where your SSI.php resides.
Title: Re: Recent posts user preference
Post by: gigabyte on November 29, 2007, 09:05:48 PM
Bug?

I found that my recent posts display was stuck on showing the 10 most recent threads regardless of what the users specified in their profile until I changed:

isset($context['user']['recentPosts']['nrofPosts']) && $modSettings['userprefsMode'] == 1 ? null : $settings['number_recent_posts'],

on line 547 of BoardIndex.php to:

isset($context['user']['recentPosts']['nrofPosts']) && $modSettings['userprefsMode'] == 1 ? $context['user']['recentPosts']['nrofPosts'] : $settings['number_recent_posts'],

Also, I think this must be a problem with the distro that I am using (Fedora) but I found that, to get the package to install through the package manager, I had to extract the package and re-pack it as a zip using the command "zip -X ../packagename.zip *" (the "-X" removes all the embedded file ownership and permissions settings).

Title: Re: Recent posts user preference
Post by: miseryshining on November 30, 2007, 06:20:41 AM
Quote from: gigabyte on November 29, 2007, 09:05:48 PM
Bug?

I found that my recent posts display was stuck on showing the 10 most recent threads regardless of what the users specified in their profile until I changed:

isset($context['user']['recentPosts']['nrofPosts']) && $modSettings['userprefsMode'] == 1 ? null : $settings['number_recent_posts'],

on line 547 of BoardIndex.php to:

isset($context['user']['recentPosts']['nrofPosts']) && $modSettings['userprefsMode'] == 1 ? $context['user']['recentPosts']['nrofPosts'] : $settings['number_recent_posts'],

nope, when using the 'null' value the function will automatically use the users preference. maybe you had "Enable extra user preferences for recent post blocks" turned off when testing it before? you can find that option under "feature and options->user preferences".

About the package, i don't know why that didnt work. Next version ill publish in zip format.
Title: Re: Recent posts user preference
Post by: gigabyte on November 30, 2007, 02:22:36 PM
My mistake, it does work with the null value but it still seems to be "sticking" with previous settings for a while (even across login/logout). It's probably because I have level 1 caching enabled.

Also, is there a simple way that I can apply the "unread messages" template as is seen when appending "?action=recenttopics" to  index.php so that I can get the recent posts to display in that table form on my main page (BoardIndex.template.php) as its own block (just above the actual board index). I would also like the users' profile settings to apply of course. I guess I could do something with frames but that would be crude and "unkosher".

Thanks,
gb
Title: Re: Recent posts user preference
Post by: gigabyte on November 30, 2007, 02:29:26 PM
Also, it is customary to uppercase the first letter of major words of titles and headers (e.g. the bread crumb on this forum). The string "Recent topics" should be "Recent Topics" (uppercase 'T') in your bread crumb.

Thanks for the great module,
Greg
Title: Re: Recent posts user preference
Post by: miseryshining on December 01, 2007, 10:43:27 AM
No, you can't just apply that template, there are some things you'd need to hack into (like i did, as nice as possible tho ;-)). you could get an extended array of values from this mod, but would have to find a way to display that then (copy parts from the unread template and create a new template from it, or something like that).

I'll change it to uppercase in the next version.
Title: Re: Recent posts user preference
Post by: fizone on December 07, 2007, 06:39:18 PM
Quote from: miseryshining on November 29, 2007, 06:00:28 AM

Quote from: fizone on November 28, 2007, 08:45:30 AM
Thank you for great job. I'm using SMF and Mambo and want to show my forums recent post in a block (module) at Mambo's first page. Any idea how to do that?

Thanks in advance!

read the first post of this topic. you can use the ssi_recentPostsPref() function to put a block anywhere you want like this:


require_once('SSI.php');
if (function_exists('ssi_recentPostsPref')) ssi_recentPostsPref();


off course you have to point it to the path where your SSI.php resides.

Thanks, I've install it and it works great for me. Only thing that I want to change in my Mambo box is to it only shows the last reply of a thread without showing boards names and date. Is it possible?

I've copied SSI.php to my root (mambo directory) and change it to point to Settings.php on line 43.

Title: Re: Recent posts user preference
Post by: JaGuR123 on December 09, 2007, 06:07:31 AM
Quote from: miseryshining on November 20, 2007, 06:35:13 AM
sorry for the late reply; the queries in SSI.php currently don't check if a topic is locked or sticky. for topics you could quite easily add the functionality to SSI.php BUT this will make it impossible to succesfully uninstall the mod with the package manager (you'd have to remove the changes again before).

Thanks MS,

Finally got around to making the changes , and all works great thanks  :D

Is it simple to do the same thing in recentPosts as well  ??

Cheers
Title: Re: Recent posts user preference
Post by: miseryshining on December 09, 2007, 10:52:14 AM
Quote from: fizone on December 07, 2007, 06:39:18 PM

Thanks, I've install it and it works great for me. Only thing that I want to change in my Mambo box is to it only shows the last reply of a thread without showing boards names and date. Is it possible?

I've copied SSI.php to my root (mambo directory) and change it to point to Settings.php on line 43.



in SSI.php search for


<td align="right" valign="top" nowrap="nowrap">
[', $post['board']['link'], ']
</td>


and remove that.

do the same for

<td align="right" nowrap="nowrap">
', $post['time'], '
</td>


there are 2 functions containing that code, you could remove it in both of them (first one is for recent posts, 2nd one for recent topics)

Quote from: JaGuR123 on December 09, 2007, 06:07:31 AM
Thanks MS,

Finally got around to making the changes , and all works great thanks  :D

Is it simple to do the same thing in recentPosts as well  ??

Cheers

no, its not possible right now since it doesnt gather any information about the topics that contain the posts. would have to change a LOT.
Title: Re: Recent posts user preference
Post by: picos on December 17, 2007, 10:00:44 AM
the recent posts are showing up at the bottom of my forum but I can't change the options because it says it can't find the recentposts template file... could you help me with that?  Also how do i move the recent topics to the top of my forum so it's seen right away? Thanks!
Title: Re: Recent posts user preference
Post by: miseryshining on December 21, 2007, 04:18:42 AM
Quote from: picos on December 17, 2007, 10:00:44 AM
the recent posts are showing up at the bottom of my forum but I can't change the options because it says it can't find the recentposts template file... could you help me with that? 

I think something went wrong during install. try to reinstall the mod. Did you get errors while installing?

Quote from: picos on December 17, 2007, 10:00:44 AM
Also how do i move the recent topics to the top of my forum so it's seen right away? Thanks!

Read the first post in this topic!
Title: Re: Recent posts user preference
Post by: Angelotus on January 04, 2008, 03:12:13 PM
Is there a way to add more options to the dropdown list that chooses the nr of recent topics?
Title: Re: Recent posts user preference
Post by: Apostaganha on January 06, 2008, 01:48:04 PM
Im getting this error:


8: Undefined index: is_read
Ficheiro: /home/apostaga/public_html/forum/Themes/default/Recent.template.php (eval?)
Linha: 159



Can someone help me on this one?

Thanks in advance!
Title: Re: Recent posts user preference
Post by: miseryshining on January 07, 2008, 06:18:32 AM
Quote from: Angelotus on January 04, 2008, 03:12:13 PM
Is there a way to add more options to the dropdown list that chooses the nr of recent topics?

just look inside the Profile.template.php file (in the Themes/default dir) and search for:

<option ',($context['user']['recentPosts']['nrofPosts'] == 5 ? 'SELECTED' : ''),'>5</option>
<option ',($context['user']['recentPosts']['nrofPosts'] == 10 || !isset($context['user']['recentPosts']['nrofPosts']) ? 'SELECTED' : ''),'>10</option>
<option ',($context['user']['recentPosts']['nrofPosts'] == 15 ? 'SELECTED' : ''),'>15</option>
<option ',($context['user']['recentPosts']['nrofPosts'] == 20 ? 'SELECTED' : ''),'>20</option>
<option ',($context['user']['recentPosts']['nrofPosts'] == 25 ? 'SELECTED' : ''),'>25</option>


im sure you'll figure it from there ;)
Title: Re: Recent posts user preference
Post by: Apostaganha on January 07, 2008, 01:09:35 PM
Quote from: Apostaganha on January 06, 2008, 01:48:04 PM
Im getting this error:


8: Undefined index: is_read
Ficheiro: /home/apostaga/public_html/forum/Themes/default/Recent.template.php (eval?)
Linha: 159



Can someone help me on this one?

Thanks in advance!


:(
Title: Re: Recent posts user preference
Post by: miseryshining on January 07, 2008, 03:04:33 PM
Quote from: Apostaganha on January 07, 2008, 01:09:35 PM
Quote from: Apostaganha on January 06, 2008, 01:48:04 PM
Im getting this error:


8: Undefined index: is_read
Ficheiro: /home/apostaga/public_html/forum/Themes/default/Recent.template.php (eval?)
Linha: 159



Can someone help me on this one?

Thanks in advance!



:(

haha, its not like your forum is breaking down because of this error, but I'll fix it in the next package release :-)
Title: Re: Recent posts user preference
Post by: Kazos on January 12, 2008, 07:16:23 PM
Hey, im a complete SMF/Php nub and need help ^^ Could someone explain to me where i put the:

require_once('SSI.php');
if (function_exists('ssi_recentPostsPref')) ssi_recentPostsPref();


code so that it displays above all of the other Categories.

Thanks to anyonehow helps ^^
Title: Re: Recent posts user preference
Post by: miseryshining on January 13, 2008, 01:03:22 PM
Quote from: Kazos on January 12, 2008, 07:16:23 PM
Hey, im a complete SMF/Php nub and need help ^^ Could someone explain to me where i put the:

require_once('SSI.php');
if (function_exists('ssi_recentPostsPref')) ssi_recentPostsPref();


code so that it displays above all of the other Categories.

Thanks to anyonehow helps ^^

it depends a bit on the theme(s) you're using but you in your BoardIndex.template.php file you should find something like this:


/* Each category in categories is made up of:
id, href, link, name, is_collapsed (is it collapsed?), can_collapse (is it okay if it is?),
new (is it new?), collapse_href (href to collapse/expand), collapse_image (up/down image),
and boards. (see below.) */
$first = true;
foreach ($context['categories'] as $category)


you could paste the code above that.
Title: Re: Recent posts user preference
Post by: Rohanx on January 17, 2008, 08:11:26 AM
After installation this addon I get error when I push on characteristics and options Warning: Unexpected character in input: ''' (ASCII=39) state=1 in /home/site/public_html/forum/Sources/ModSettings.php on line 335

Parse error: syntax error, unexpected $end, expecting ')' in /home/site/public_html/forum/Sources/ModSettings.php on line 335


335 string // Who can do it.... and who is restricted by time limits?
array('int', 'karmaMinPosts'),
array('float', 'karmaWait),
Title: Re: Recent posts user preference
Post by: Jade Elizabeth on January 17, 2008, 08:18:37 AM
What version is your forum?
Title: Re: Recent posts user preference
Post by: Rohanx on January 17, 2008, 08:28:07 AM
Latest -- 1.1.4
Title: Re: Recent posts user preference
Post by: miseryshining on January 17, 2008, 11:13:44 AM
Quote from: Rohanx on January 17, 2008, 08:11:26 AM
After installation this addon I get error when I push on characteristics and options Warning: Unexpected character in input: ''' (ASCII=39) state=1 in /home/site/public_html/forum/Sources/ModSettings.php on line 335

Parse error: syntax error, unexpected $end, expecting ')' in /home/site/public_html/forum/Sources/ModSettings.php on line 335


335 string // Who can do it.... and who is restricted by time limits?
array('int', 'karmaMinPosts'),
array('float', 'karmaWait),


recent posts mod doesnt change that part of the code, but obviously there's an ' missing after karmaWait

i updated the package with some bug fixes, upped the version to 2.4:
-the recent topics action wasnt displaying real member names
-fixed undefined indexes
-now in zip package since tar.gz caused some problems for some users.
Title: Re: Recent posts user preference
Post by: Rohanx on January 17, 2008, 01:05:13 PM
Sorry for stupid question but I can't found any menu for this addon an admin panel...

P.S. thanks, for so fast fix!
Title: Re: Recent posts user preference
Post by: Angelotus on January 17, 2008, 03:50:00 PM
Me to, how can I change the way recent posts are shown in default for all users?
Title: Re: Recent posts user preference
Post by: YourLocalNerd on January 21, 2008, 11:34:26 AM
I've tried downloading the most recent version from 2 different location and both come up as corrupt files.

This is the file I am attempting to download: http://custom.simplemachines.org/mods/index.php?action=download;mod=654;id=41851

Help would greatly be appreciated!
Title: Re: Recent posts user preference
Post by: miseryshining on January 21, 2008, 01:30:22 PM
Quote from: Rohanx on January 17, 2008, 01:05:13 PM
Sorry for stupid question but I can't found any menu for this addon an admin panel...

P.S. thanks, for so fast fix!

there's an option under "features and options" => "user preferences".

for the default theme (and most others) there's an option under "current theme" => "Use recent topics mode instead on board index"

Quote from: YourLocalNerd on January 21, 2008, 11:34:26 AM
I've tried downloading the most recent version from 2 different location and both come up as corrupt files.

This is the file I am attempting to download: http://custom.simplemachines.org/mods/index.php?action=download;mod=654;id=41851

Help would greatly be appreciated!

The file got corrupted due to the recent SMF server outage i think. i re-uploaded version 2.4 (which was lost as well).
Title: Re: Recent posts user preference
Post by: YourLocalNerd on January 21, 2008, 02:41:01 PM
Thanks for the quick reply and awesome mod!  Works as advertised!
Title: Re: Recent posts user preference
Post by: goran on January 23, 2008, 11:53:26 AM
I have tried to install this mod but the test failed for the file SSI.php ??
Title: Re: Recent posts user preference
Post by: miseryshining on January 23, 2008, 01:29:31 PM
Quote from: goran on January 23, 2008, 11:53:26 AM
I have tried to install this mod but the test failed for the file SSI.php ??

2 possibilities:

1. you use an SMF version other then 1.1
2. another mod has altered the SSI.php file.
Title: Re: Recent posts user preference
Post by: goran on January 23, 2008, 05:08:39 PM
I am using 114. So how can I found out which mod makes problems?
Title: Re: Recent posts user preference
Post by: miseryshining on January 24, 2008, 04:44:30 AM
Quote from: goran on January 23, 2008, 05:08:39 PM
I am using 114. So how can I found out which mod makes problems?

uninstall all mods one by one and try to install recent posts mod after it :-)
Title: Re: Recent posts user preference
Post by: JaGuR123 on January 24, 2008, 04:52:49 AM
Quote from: miseryshining on January 24, 2008, 04:44:30 AM
Quote from: goran on January 23, 2008, 05:08:39 PM
I am using 114. So how can I found out which mod makes problems?

uninstall all mods one by one and try to install recent posts mod after it :-)

Lol

:P
Title: Re: Recent posts user preference
Post by: kamili34 on January 25, 2008, 08:56:16 PM
Will check thanks.
Title: Re: Recent posts user preference
Post by: NEMINI on February 01, 2008, 03:58:02 AM
my block seem to show various number of recent topics irregardless of what the setting is.  it seems to be related to what forums are chosen to show.

Ie: if I have all forums showing and 15 topics chosen it shows 15.  but if I have forum A, B, C but not D or E and 15 topics to show it will show less then 15.  it's like its counting ALL recent posts and just not showing the forums unchecked rather then showing 15 topics from the forum chosen.

hope that makes some sense, if not I can provide links to my site and a test account.

Title: Re: Recent posts user preference
Post by: miseryshining on February 01, 2008, 04:36:48 AM
Quote from: NEMINI on February 01, 2008, 03:58:02 AM
my block seem to show various number of recent topics irregardless of what the setting is.  it seems to be related to what forums are chosen to show.

Ie: if I have all forums showing and 15 topics chosen it shows 15.  but if I have forum A, B, C but not D or E and 15 topics to show it will show less then 15.  it's like its counting ALL recent posts and just not showing the forums unchecked rather then showing 15 topics from the forum chosen.

hope that makes some sense, if not I can provide links to my site and a test account.



its not really a bug but how it's programmed (the query will only search a limited number of posts and threads). since it's supposed to display recent topics, if there have been many posts in boards other then the ones you choose to display, it's likely that there aren't many recent topics to display for these boards.

possibly i could change it's behaviour a bit so that when you add a date limitation (last 2 days for instance), it will search through all posts in that time period.
Title: Re: Recent posts user preference
Post by: NEMINI on February 02, 2008, 01:15:25 AM
why the limit?  shouldn't it just find the most recent X posts/topics irregardless of date?  what about a slow forum that might only have 5 posts a day and someone visits once a week and wants to see the latest 25?
Title: Re: Recent posts user preference
Post by: miseryshining on February 02, 2008, 07:29:31 PM
Quote from: NEMINI on February 02, 2008, 01:15:25 AM
why the limit?  shouldn't it just find the most recent X posts/topics irregardless of date?  what about a slow forum that might only have 5 posts a day and someone visits once a week and wants to see the latest 25?

Performance considerations. The query does not know when it will find the 25th thread with new posts, worst case it will have to search the complete message table. For the recent topics list (action=recenttopics) i changed the behaviour when you limit it to x days. it will then find all relevant threads in that time span. Will upload a new version soon.
Title: Re: Recent posts user preference
Post by: NEMINI on February 05, 2008, 12:00:16 AM
okay.
Title: Re: Recent posts user preference
Post by: miseryshining on February 06, 2008, 05:53:37 AM
Quote from: NEMINI on February 05, 2008, 12:00:16 AM
okay.

In the next version i'll introduce a setting for admins to specify a timeframe in which to search for recent posts/topics, so you can find out for yourself if performance becomes an issue. Also i will add and regroup recent posts/topics related settings for admins so it's easier to set up blocks.
Title: Re: Recent posts user preference
Post by: NEMINI on February 07, 2008, 12:00:22 AM
i am looking forward to it
Title: Re: Recent posts user preference
Post by: miseryshining on February 07, 2008, 12:00:17 PM
Quote from: NEMINI on February 07, 2008, 12:00:22 AM
i am looking forward to it
Updated to 2.5. Make sure you uninstall the old version first.
Title: Re: Recent posts user preference
Post by: NEMINI on February 08, 2008, 12:33:10 AM
have it installed. will report back on performance/whatnot after my users thrash it around for a while.  thank you for your work on this.
Title: Re: Recent posts user preference
Post by: miseryshining on February 08, 2008, 04:32:20 AM
I uploaded a new package with some important fixes (it wasnt showing any posts for the majority of users..). Please download the latest package (2.51). Feedback appreciated!
Title: Re: Recent posts user preference
Post by: Sarai on February 15, 2008, 06:43:47 PM
Hi, I've read every page since the beginning just to see the development of the mod. I'm running SMF 1.1.4.

Quoterecent topics page example
http://www.yourforum.com/index.php?action=recenttopics;boards=2,4;limit=1
(will show a list of recent topics from boards 2 and 4, limited to the last day)

I tried to set the limit for 2 days, but it did not work. Is it supposed to, or am I trying to perform an action that does not exist?

Quote[admins]
"features and options -> user preferences"

    * enable extra user settings for users (only relevant for blocks)

"Current Theme -> Use recent topics mode instead on board index"

    * display recent topics for guests and members that haven't changed config

I don't see any of these options in my Admin panel. Did I download the wrong package or have I done something wrong?

Title: Re: Recent posts user preference
Post by: miseryshining on February 16, 2008, 05:06:59 AM
Quote from: Sarai on February 15, 2008, 06:43:47 PM
Hi, I've read every page since the beginning just to see the development of the mod. I'm running SMF 1.1.4.

Quoterecent topics page example
http://www.yourforum.com/index.php?action=recenttopics;boards=2,4;limit=1
(will show a list of recent topics from boards 2 and 4, limited to the last day)

I tried to set the limit for 2 days, but it did not work. Is it supposed to, or am I trying to perform an action that does not exist?

it should work if you set the day limit in the admin panel to 2 days or higher. if it's not set it might not give the expected result. 

Quote
Quote[admins]
"features and options -> user preferences"

    * enable extra user settings for users (only relevant for blocks)

"Current Theme -> Use recent topics mode instead on board index"

    * display recent topics for guests and members that haven't changed config

I don't see any of these options in my Admin panel. Did I download the wrong package or have I done something wrong?



hmm, you will need 2.51 for that (latest package). i updated the documentation, you should see the following in your admin panel:

Quote
[admins]
"features and options -> Recent posts/topics"

    * enable extra user settings for users (only relevant for blocks)
    * Use recent topics mode instead on board index
    * Nr of posts to whow in blocks by default
    * Timeframe in which to search for recent posts/topics (in days)
Title: Re: Recent posts user preference
Post by: NEMINI on March 05, 2008, 02:02:01 PM
after having had mine set for a 10 day limit for the past month, I can safely report there has been zero performance impact to my site.  All user issues appear to have been resolved.  Thank you.
Title: Re: Recent posts user preference
Post by: miseryshining on March 07, 2008, 04:31:24 AM
Quote from: NEMINI on March 05, 2008, 02:02:01 PM
after having had mine set for a 10 day limit for the past month, I can safely report there has been zero performance impact to my site.  All user issues appear to have been resolved.  Thank you.

thanks for the feedback, good to know!
Title: Re: Recent posts user preference
Post by: Chopper on March 26, 2008, 06:11:38 PM
I get this error upon install:

Installing this package will perform the following actions:  Type Action Description
1. Execute Code RP_db.php 
2. Execute Modification .//Themes/default/languages/Profile.english.php Test successful
3. Execute Modification .//Themes/default/languages/ModSettings.english.php Test successful
4. Execute Modification .//Themes/default/languages/index.english.php Test successful
5. Execute Modification .//Sources/Load.php Test successful
6. Execute Modification .//SSI.php Test failed  
7. Execute Modification .//Sources/Profile.php Test successful
8. Execute Modification .//Themes/default/Profile.template.php Test successful
9. Execute Modification .//Sources/Recent.php Test successful
10. Execute Modification .//Themes/default/Recent.template.php Test failed  
11. Execute Modification .//Sources/BoardIndex.php Test successful
12. Execute Modification .//index.php Test successful
13. Execute Modification .//Sources/ModSettings.php Test successful
-----------------------------------------------------------------------------------------

Is there anyway i can still install this?

Thanks
Title: Re: Recent posts user preference
Post by: miseryshining on March 27, 2008, 05:20:48 AM
Quote from: Chopper on March 26, 2008, 06:11:38 PM
I get this error upon install:

Installing this package will perform the following actions:  Type Action Description
1. Execute Code RP_db.php 
2. Execute Modification .//Themes/default/languages/Profile.english.php Test successful
3. Execute Modification .//Themes/default/languages/ModSettings.english.php Test successful
4. Execute Modification .//Themes/default/languages/index.english.php Test successful
5. Execute Modification .//Sources/Load.php Test successful
6. Execute Modification .//SSI.php Test failed  
7. Execute Modification .//Sources/Profile.php Test successful
8. Execute Modification .//Themes/default/Profile.template.php Test successful
9. Execute Modification .//Sources/Recent.php Test successful
10. Execute Modification .//Themes/default/Recent.template.php Test failed  
11. Execute Modification .//Sources/BoardIndex.php Test successful
12. Execute Modification .//index.php Test successful
13. Execute Modification .//Sources/ModSettings.php Test successful
-----------------------------------------------------------------------------------------

Is there anyway i can still install this?

Thanks

Uninstall all modifications, then try to install it again. It's likely that another modification has changed these files. I assume you are using the latest SMF version.
Title: Re: Recent posts user preference
Post by: Chopper on March 27, 2008, 06:40:27 AM
Im using 1.1.4 . Dont want to try 2.0 as its at beta stage
Title: Re: Recent posts user preference
Post by: miseryshining on March 27, 2008, 08:08:35 AM
Quote from: Chopper on March 27, 2008, 06:40:27 AM
Im using 1.1.4 . Dont want to try 2.0 as its at beta stage

yes, latest stable i meant = 1.1.4
Title: Re: Recent posts user preference
Post by: Chopper on March 27, 2008, 10:11:21 AM
I done as you said but still the same errors??

How do i manually install?
Title: Re: Recent posts user preference
Post by: miseryshining on March 27, 2008, 12:11:08 PM
Quote from: Chopper on March 27, 2008, 10:11:21 AM
I done as you said but still the same errors??

How do i manually install?

I wouldn't do it manually. its better to backup these two files which give you the erros and replace them with the files that original came with the 1.1.4 package. that should fix it for sure.
Title: Re: Recent posts user preference
Post by: niksy on April 21, 2008, 04:44:03 AM
Hello,

I get this error message:

8: Undefined index: recentpostsExtraprefs
File: /home/tvzino/public_html/forum/SSI.php
Line: 247


How can I fix it? I am using SMF 1.1.4.

Thanks!
Title: Re: Recent posts user preference
Post by: miseryshining on April 21, 2008, 07:08:04 AM
Quote from: niksy on April 21, 2008, 04:44:03 AM
Hello,

I get this error message:

8: Undefined index: recentpostsExtraprefs
File: /home/tvzino/public_html/forum/SSI.php
Line: 247


How can I fix it? I am using SMF 1.1.4.

Thanks!

Did you get any errors during install? Was it able to do all modifications? (if not you would see some lines highlighted in red during install + a warning)
Title: Re: Recent posts user preference
Post by: niksy on April 21, 2008, 07:34:32 AM
Everything installed successfully.

I'm not using
require_once('SSI.php');
if (function_exists('ssi_recentPostsPref')) ssi_recentPostsPref();
on the front page, but it's working fine (it shows me custom number of posts), but it creates huge log file which makes site very slow.
Is this may cause a problem?
Title: Re: Recent posts user preference
Post by: miseryshining on April 21, 2008, 01:06:22 PM
Quote from: niksy on April 21, 2008, 07:34:32 AM
Everything installed successfully.

I'm not using
require_once('SSI.php');
if (function_exists('ssi_recentPostsPref')) ssi_recentPostsPref();
on the front page, but it's working fine (it shows me custom number of posts), but it creates huge log file which makes site very slow.
Is this may cause a problem?

it might be caused because the value haven't been set in the administrative settings. go to:
admin->features & options-> recent posts and topics
tick "   Enable extra user preferences for recent post blocks" and save. if you wish to disable the option untick again and save.

Please tell me if that solved it so i can fix this permanently.
Title: Re: Recent posts user preference
Post by: niksy on April 24, 2008, 06:33:06 PM
Well I think it fixed it, it doesn't show in error log anymore.
Title: Re: Recent posts user preference
Post by: Leemy on April 25, 2008, 11:41:21 PM
I am completely new to all of this. I installed your mod with no errors but was unsuccessful to "insert the code block whereever I want it to show".  I tried going through all the different php files to make sure the installation was successful and all the inserts/edits look complete.
my site is http://bhangrateamsforum.com/discuss/index.php
and i want to show this nice grid you made either above the listing of the boards or below.  WHERE can i put that code snippet, which part of which PHP file? PLEASE advise, thank you.
Title: Re: Recent posts user preference
Post by: Leemy on April 29, 2008, 12:42:10 AM
Quote from: Saleem on April 25, 2008, 11:41:21 PM
I am completely new to all of this. I installed your mod with no errors but was unsuccessful to "insert the code block whereever I want it to show".  I tried going through all the different php files to make sure the installation was successful and all the inserts/edits look complete.
my site is http://bhangrateamsforum.com/discuss/index.php
and i want to show this nice grid you made either above the listing of the boards or below.  WHERE can i put that code snippet, which part of which PHP file? PLEASE advise, thank you.

so this line was in my boardindex.php but i cant get the 'extended' mode it gives nothing, only the columns for array, what to do?

$context['latest_posts'] = ssi_recentPostspref(null, null, 'array', null, null, null);;
Title: Re: Recent posts user preference
Post by: miseryshining on April 29, 2008, 03:55:51 PM
Quote from: Saleem on April 29, 2008, 12:42:10 AM
Quote from: Saleem on April 25, 2008, 11:41:21 PM
I am completely new to all of this. I installed your mod with no errors but was unsuccessful to "insert the code block whereever I want it to show".  I tried going through all the different php files to make sure the installation was successful and all the inserts/edits look complete.
my site is http://bhangrateamsforum.com/discuss/index.php
and i want to show this nice grid you made either above the listing of the boards or below.  WHERE can i put that code snippet, which part of which PHP file? PLEASE advise, thank you.

so this line was in my boardindex.php but i cant get the 'extended' mode it gives nothing, only the columns for array, what to do?

$context['latest_posts'] = ssi_recentPostspref(null, null, 'array', null, null, null);;

Hmm, im not sure what you want to do. The grid with extended info can only be shown on its own page. You can read detailed instructions about how to use the mod in the opening post (http://www.simplemachines.org/community/index.php?topic=158917.0)
Title: Re: Recent posts user preference
Post by: slackerpunk on June 06, 2008, 01:49:44 AM
anyone using this with 1.1.5?
Title: Re: Recent posts user preference
Post by: FragaCampos on June 06, 2008, 04:29:26 PM
Yep :)
Title: Re: Recent posts user preference
Post by: Angelle on June 11, 2008, 11:21:50 AM
How did you get this to install?  It won't even install when I tried to install it on 1.1.5
Title: Re: Recent posts user preference
Post by: Mimmi on June 12, 2008, 04:33:12 PM
I would also like an upgrade for 1.1.5.!
Title: Re: Recent posts user preference
Post by: NEMINI on June 12, 2008, 04:52:51 PM
use this and it installs and works just fine:

index.php?action=packages;version_emulate=1.1.4
Title: Re: Recent posts user preference
Post by: Mimmi on June 13, 2008, 02:17:17 AM
Quote from: NEMINI on June 12, 2008, 04:52:51 PM
use this and it installs and works just fine:

index.php?action=packages;version_emulate=1.1.4

I have to do a manual installation. Is that possible with 1.1.5?
Title: Re: Recent posts user preference
Post by: NEMINI on June 13, 2008, 02:29:31 AM
manual installations are possible with any version.
Title: Re: Recent posts user preference
Post by: Mimmi on June 13, 2008, 03:19:23 AM
Quote from: NEMINI on June 13, 2008, 02:29:31 AM
manual installations are possible with any version.

There are no instructions for 1.1.5. Or can you direct me?
Title: Re: Recent posts user preference
Post by: NEMINI on June 13, 2008, 04:16:21 AM
just set the drop down to 1.1.4 they are virtually the same.
Title: Re: Recent posts user preference
Post by: beeawin on June 13, 2008, 04:45:33 AM
Quote from: NEMINI on June 13, 2008, 04:16:21 AM
just set the drop down to 1.1.4 they are virtually the same.

How to do ?
Title: Re: Recent posts user preference
Post by: miseryshining on June 13, 2008, 07:37:57 AM
Quote from: beeawin on June 13, 2008, 04:45:33 AM
Quote from: NEMINI on June 13, 2008, 04:16:21 AM
just set the drop down to 1.1.4 they are virtually the same.

How to do ?

i updated the mod:

-2.52 adds support for 1.1.5 and hopefully fixes the remaining undefined indexes.

Title: Re: Recent posts user preference
Post by: Mimmi on June 13, 2008, 08:51:47 AM
Quote from: miseryshining on June 13, 2008, 07:37:57 AM
i updated the mod:

-2.52 adds support for 1.1.5 and hopefully fixes the remaining undefined indexes.


Wouvou! That's what I call fast service. Thank you! :D
Title: Re: Recent posts user preference
Post by: Mimmi on June 13, 2008, 05:50:15 PM
I have an error I can't figure out:

When trying to go to
http://.../index.php?action=profile I get:

QuoteParse error: syntax error, unexpected T_ISSET, expecting '&' or T_VARIABLE in /.../Sources/Profile.php on line 947

The line reads:
QuotemakeThemeChanges($memID, isset($_POST['ID_THEME']) ? (int) $_POST['ID_THEME'] : $old_profile['ID_THEME']);

What should I do?
Title: Re: Recent posts user preference
Post by: miseryshining on June 14, 2008, 06:53:51 AM
Quote from: Mimmi on June 13, 2008, 05:50:15 PM
I have an error I can't figure out:

When trying to go to
http://.../index.php?action=profile I get:

QuoteParse error: syntax error, unexpected T_ISSET, expecting '&' or T_VARIABLE in /.../Sources/Profile.php on line 947

The line reads:
QuotemakeThemeChanges($memID, isset($_POST['ID_THEME']) ? (int) $_POST['ID_THEME'] : $old_profile['ID_THEME']);

What should I do?


can you also post the surrounding lines of code please?
Title: Re: Recent posts user preference
Post by: Mimmi on June 15, 2008, 06:37:23 AM
Quote from: miseryshining on June 14, 2008, 06:53:51 AM
can you also post the surrounding lines of code please?

The problem is solved. I think it had something to do with the following error: I upgraded the forum from the Administration Center and thought I then was using the 1.1.5 version, but it failed without me understanding it, so I was still using 1.1.4. My cousin, who owns the server, upgrated to 1.1.5 manually. After that he tried to install the mod package, but somehow it didn't work out. When I installed the mod manually, the error disappeared. I did however encounter another problem. I'll put that in a new post.

I put the original problem code here just in case you or someone else may use it:
// Make any theme changes that are sent with the profile..
function 
makeThemeChanges($memID, isset($_POST['ID_THEME']) ? (int) $_POST['ID_THEME'] : $old_profile['ID_THEME']);
makeRecentPostsChanges($memID)
{
global $db_prefix, $modSettings;

// These are the theme changes...
$themeSetArray = array();
if (isset($_POST['options']) && is_array($_POST['options']))
{
foreach ($_POST['options'] as $opt => $val)
$themeSetArray[] = '(' . $memID . ', ' . $ID_THEME . ", SUBSTRING('" . addslashes($opt) . "', 1, 255), SUBSTRING('" . (is_array($val) ? implode(',', $val) : $val) . "', 1, 65534))";
}

$erase_options = array();
if (isset($_POST['default_options']) && is_array($_POST['default_options']))
foreach ($_POST['default_options'] as $opt => $val)
{
$themeSetArray[] = "($memID, 1, SUBSTRING('" . addslashes($opt) . "', 1, 255), SUBSTRING('" . (is_array($val) ? implode(',', $val) : $val) . "', 1, 65534))";
$erase_options[] = addslashes($opt);
}

// If themeSetArray isn't still empty, send it to the database.
if (!empty($themeSetArray))
{
db_query("
REPLACE INTO {$db_prefix}themes
(ID_MEMBER, ID_THEME, variable, value)
VALUES " . implode(",
", $themeSetArray), __FILE__, __LINE__);
}

if (!empty($erase_options))
{
db_query("
DELETE FROM {$db_prefix}themes
WHERE ID_THEME != 1
AND variable IN ('" . implode("', '", $erase_options) . "')
AND ID_MEMBER = $memID", __FILE__, __LINE__);
}

$themes = explode(',', $modSettings['knownThemes']);
foreach ($themes as $t)
cache_put_data('theme_settings-' . $t . ':' . $memID, null, 60);
}
Title: Re: Recent posts user preference
Post by: Mimmi on June 15, 2008, 06:53:52 AM
As I said in the post above I encountered a problem when trying to install the mod manually on forum version 1.1.5:

When trying to open http://.../index.php?action=recent I got the following error message:

Template Parse Error!
There was a problem loading the /Themes/default/Recent.template.php template or language file.  Please check the syntax and try again - remember, single quotes (') often have to be escaped with a slash (\).  To see more specific error information from PHP, try accessing the file directly (http://forum.altern.no/Themes/default/Recent.template.php).

You may want to try to refresh this page or use the default theme (http://forum.altern.no/index.php?theme=1).
      


      syntax error, unexpected ','

I compared the Recent.template.php from my first and last installation of the mod and decided to to use the old version of the file. Then everythin worked fine, except for one thing: I can't access the Recent post settings. The link is there both in the Administration panel and in my Profile, but when I click on it nothing happens in the Admin and in my Profile I get an error message:
QuoteAn Error Has Occurred!
Unable to load the 'recentPosts' template.

I guess there is just some small detail I haven't understood or done right... I apologize, I'm not familiar with php code...  :-[

I attach a Word-file that shows the difference between the old and new version of Recent.template.php. The text in red is from the new (failed) version.

By the way: This is how the mod works:
http://.../index.php?action=recenttopics looks like the image here (http://custom.simplemachines.org/mods/index.php?action=download;mod=654;id=48995;image).
http://.../index.php?action=recent looks like it's always done.
Title: Re: Recent posts user preference
Post by: miseryshining on June 15, 2008, 10:05:44 AM
Quote from: Mimmi on June 15, 2008, 06:53:52 AM
As I said in the post above I encountered a problem when trying to install the mod manually on forum version 1.1.5:

When trying to open http://.../index.php?action=recent I got the following error message:

Template Parse Error!
There was a problem loading the /Themes/default/Recent.template.php template or language file.  Please check the syntax and try again - remember, single quotes (') often have to be escaped with a slash (\).  To see more specific error information from PHP, try accessing the file directly (http://forum.altern.no/Themes/default/Recent.template.php).

You may want to try to refresh this page or use the default theme (http://forum.altern.no/index.php?theme=1).
      


      syntax error, unexpected ','

I compared the Recent.template.php from my first and last installation of the mod and decided to to use the old version of the file. Then everythin worked fine, except for one thing: I can't access the Recent post settings. The link is there both in the Administration panel and in my Profile, but when I click on it nothing happens in the Admin and in my Profile I get an error message:
QuoteAn Error Has Occurred!
Unable to load the 'recentPosts' template.

I guess there is just some small detail I haven't understood or done right... I apologize, I'm not familiar with php code...  :-[

I attach a Word-file that shows the difference between the old and new version of Recent.template.php. The text in red is from the new (failed) version.

By the way: This is how the mod works:
http://.../index.php?action=recenttopics looks like the image here (http://custom.simplemachines.org/mods/index.php?action=download;mod=654;id=48995;image).
http://.../index.php?action=recent looks like it's always done.

you made a mistake in this line (160):

<img src="' . $settings['images_url'] . '/icons/show_sticky.gif" align="right" alt="" style="margin: 0;" />' : '', $topic['first_post']['link'], $topic['is_read'] == 0 ? ' <a href="',. $topic['new_href'],]. '"><img src="',. $settings['images_url'],]. '/',. $context['user']['language'],]. '/new.gif" alt="',. $txt[302],]. '" /></a> ' : '', '<span class="smalltext">', $topic['pages'], ' ', $txt['smf88'], ' ', $topic['board']['link'], '</span></td>

replace it with this (from the mod):

<img src="' . $settings['images_url'] . '/icons/show_sticky.gif" align="right" alt="" style="margin: 0;" />' : '', $topic['first_post']['link'], $topic['is_read'] == 0 ? ' <a href="'. $topic['new_href']. '"><img src="'. $settings['images_url']. '/'. $context['user']['language']. '/new.gif" alt="'. $txt[302]. '" /></a>' : '', '<span class="smalltext">', $topic['pages'], ' ', $txt['smf88'], ' ', $topic['board']['link'], '</span></td>

and you made some mistakes here as well:

<td>> <a href="', $scripturl, '?action=unreadreplies'', isset($_REQUEST['action']) ? $_REQUEST['action'] : 'unread', $context['showing_all_topics'] ? ';all' : '', $context['querystring_board_limits'], isset($context['querystring_day_limits']) ? $context['querystring_day_limits'] : '', ';sort=subject', $context['sort_by'] == 'subject' && $context['sort_direction'] == 'up' ? ';desc' : '', '">', $txt[70], $context['sort_by'] == 'subject' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" border="0" />' : '', '</a>> </td>
<td width="14%">%"> <a href="', $scripturl, '?action=unreadreplies'', isset($_REQUEST['action']) ? $_REQUEST['action'] : 'unread', $context['showing_all_topics'] ? ';all' : '', $context['querystring_board_limits'], isset($context['querystring_day_limits']) ? $context['querystring_day_limits'] : '', ';sort=starter', $context['sort_by'] == 'starter' && $context['sort_direction'] == 'up' ? ';desc' : '', '">', $txt[109], $context['sort_by'] == 'starter' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" border="0" />' : '', '</a>> </td>
<td width="4%" align="center">"> <a href="', $scripturl, '?action=unreadreplies'', isset($_REQUEST['action']) ? $_REQUEST['action'] : 'unread', $context['showing_all_topics'] ? ';all' : '', $context['querystring_board_limits'], isset($context['querystring_day_limits']) ? $context['querystring_day_limits'] : '', ';sort=replies', $context['sort_by'] == 'replies' && $context['sort_direction'] == 'up' ? ';desc' : '', '">', $txt[110], $context['sort_by'] == 'replies' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" border="0" />' : '', '</a>> </td>
<td width="4%" align="center">"> <a href="', $scripturl, '?action=unreadreplies'', isset($_REQUEST['action']) ? $_REQUEST['action'] : 'unread', $context['showing_all_topics'] ? ';all' : '', $context['querystring_board_limits'], isset($context['querystring_day_limits']) ? $context['querystring_day_limits'] : '', ';sort=views', $context['sort_by'] == 'views' && $context['sort_direction'] == 'up' ? ';desc' : '', '">', $txt[301], $context['sort_by'] == 'views' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" border="0" />' : '', '</a>> </td>
<td width="24%">%"> <a href="', $scripturl, '?action=unreadreplies'', isset($_REQUEST['action']) ? $_REQUEST['action'] : 'unread', $context['showing_all_topics'] ? ';all' : '', $context['querystring_board_limits'], isset($context['querystring_day_limits']) ? $context['querystring_day_limits'] : '', ';sort=last_post', $context['sort_by'] == 'last_post' && $context['sort_direction'] == 'up' ? ';desc' : '', '">', $txt[111], $context['sort_by'] == 'last_post' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" border="0" />' : '', '</a>> </td>';


replace with this:

<td> <a href="', $scripturl, '?action=unreadreplies', isset($_REQUEST['action']) ? $_REQUEST['action'] : 'unread', $context['showing_all_topics'] ? ';all' : '', $context['querystring_board_limits'], isset($context['querystring_day_limits']) ? $context['querystring_day_limits'] : '', ';sort=subject', $context['sort_by'] == 'subject' && $context['sort_direction'] == 'up' ? ';desc' : '', '">', $txt[70], $context['sort_by'] == 'subject' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" border="0" />' : '', '</a> </td>
<td width="14%"> <a href="', $scripturl, '?action=unreadreplies', isset($_REQUEST['action']) ? $_REQUEST['action'] : 'unread', $context['showing_all_topics'] ? ';all' : '', $context['querystring_board_limits'], isset($context['querystring_day_limits']) ? $context['querystring_day_limits'] : '', ';sort=starter', $context['sort_by'] == 'starter' && $context['sort_direction'] == 'up' ? ';desc' : '', '">', $txt[109], $context['sort_by'] == 'starter' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" border="0" />' : '', '</a> </td>
<td width="4%" align="center"> <a href="', $scripturl, '?action=unreadreplies', isset($_REQUEST['action']) ? $_REQUEST['action'] : 'unread', $context['showing_all_topics'] ? ';all' : '', $context['querystring_board_limits'], isset($context['querystring_day_limits']) ? $context['querystring_day_limits'] : '', ';sort=replies', $context['sort_by'] == 'replies' && $context['sort_direction'] == 'up' ? ';desc' : '', '">', $txt[110], $context['sort_by'] == 'replies' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" border="0" />' : '', '</a> </td>
<td width="4%" align="center"> <a href="', $scripturl, '?action=unreadreplies', isset($_REQUEST['action']) ? $_REQUEST['action'] : 'unread', $context['showing_all_topics'] ? ';all' : '', $context['querystring_board_limits'], isset($context['querystring_day_limits']) ? $context['querystring_day_limits'] : '', ';sort=views', $context['sort_by'] == 'views' && $context['sort_direction'] == 'up' ? ';desc' : '', '">', $txt[301], $context['sort_by'] == 'views' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" border="0" />' : '', '</a> </td>
<td width="24%"> <a href="', $scripturl, '?action=unreadreplies', isset($_REQUEST['action']) ? $_REQUEST['action'] : 'unread', $context['showing_all_topics'] ? ';all' : '', $context['querystring_board_limits'], isset($context['querystring_day_limits']) ? $context['querystring_day_limits'] : '', ';sort=last_post', $context['sort_by'] == 'last_post' && $context['sort_direction'] == 'up' ? ';desc' : '', '">', $txt[111], $context['sort_by'] == 'last_post' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" border="0" />' : '', '</a> </td>';


it looked pretty messed up so i can't guarantee that this fixes everything.
Title: Re: Recent posts user preference
Post by: miseryshining on June 15, 2008, 12:03:14 PM
new version posted:

-3.00 adds support for 2.0 beta 3.*, admin settings are moved to configuration->modifications.

please test! (quite some under the hood changes..)
Title: Re: Recent posts user preference
Post by: Mimmi on June 15, 2008, 01:37:59 PM
Quote from: miseryshining on June 15, 2008, 10:05:44 AM

it looked pretty messed up so i can't guarantee that this fixes everything.

I found a couple of other mistakes to (in red) and now it worked out. At least I don't get the Template Parse Error! message anymore, but I'm still not able to access the Recent post settings. Any suggestion?
Title: Re: Recent posts user preference
Post by: miseryshining on June 15, 2008, 03:39:20 PM
Quote from: Mimmi on June 15, 2008, 01:37:59 PM
Quote from: miseryshining on June 15, 2008, 10:05:44 AM

it looked pretty messed up so i can't guarantee that this fixes everything.

I found a couple of other mistakes to (in red) and now it worked out. At least I don't get the Template Parse Error! message anymore, but I'm still not able to access the Recent post settings. Any suggestion?

the ones inside the profile you mean? or in the admin panel?
Title: Re: Recent posts user preference
Post by: Mimmi on June 15, 2008, 04:10:38 PM
Quote from: miseryshining on June 15, 2008, 03:39:20 PM
Quote from: Mimmi on June 15, 2008, 01:37:59 PM
Quote from: miseryshining on June 15, 2008, 10:05:44 AM

it looked pretty messed up so i can't guarantee that this fixes everything.

I found a couple of other mistakes to (in red) and now it worked out. At least I don't get the Template Parse Error! message anymore, but I'm still not able to access the Recent post settings. Any suggestion?

the ones inside the profile you mean? or in the admin panel?

Both, as I described above:
I can't access the Recent post settings. The link is there both in the Administration panel and in my Profile, but when I click on it nothing happens in the Admin and in my Profile I get an error message:
QuoteAn Error Has Occurred!
Unable to load the 'recentPosts' template.
Title: Re: Recent posts user preference
Post by: miseryshining on June 15, 2008, 05:07:18 PM
Quote from: Mimmi on June 15, 2008, 04:10:38 PM
Quote from: miseryshining on June 15, 2008, 03:39:20 PM
Quote from: Mimmi on June 15, 2008, 01:37:59 PM
Quote from: miseryshining on June 15, 2008, 10:05:44 AM

it looked pretty messed up so i can't guarantee that this fixes everything.

I found a couple of other mistakes to (in red) and now it worked out. At least I don't get the Template Parse Error! message anymore, but I'm still not able to access the Recent post settings. Any suggestion?

the ones inside the profile you mean? or in the admin panel?

Both, as I described above:
I can't access the Recent post settings. The link is there both in the Administration panel and in my Profile, but when I click on it nothing happens in the Admin and in my Profile I get an error message:
QuoteAn Error Has Occurred!
Unable to load the 'recentPosts' template.

hmm, it seems many things got scrambled in your install, im afraid i cant really help you other then advising to start with a fresh forum install if you can.
Title: Re: Recent posts user preference
Post by: Mimmi on June 17, 2008, 03:08:59 PM
Quote from: miseryshining on June 15, 2008, 05:07:18 PM
hmm, it seems many things got scrambled in your install, im afraid i cant really help you other then advising to start with a fresh forum install if you can.

I haven't done a fresh install, but: Hurray! I located one mistake :D: In the /Sources/ModSettings.php the  'recentposts' => 'ModifyRecentpostsSettings', should be added before the  'karma' => 'ModifyKarmaSettings', twice. I had only did it once! So now I can make changes in the Recent posts/topics in the Administration panel, but I still get the same error message trying to access it from my Profile. I'll get back if I find a solution for that problem too.
Title: Re: Recent posts user preference
Post by: Mimmi on June 17, 2008, 03:30:48 PM
I found the second mistake to! In the /Themes/default/Profile.template.php I had added the script as described on the manual installation guide, but when pasting it into Dreamweaver all line breaks etc disappeared. I always tried to put them back in again in the right places, but here I missed the most important one: the one between
// Template for showing recent posts settings and
. function template_recentPosts()

Now everything works great and I'm thrilled! So will my users be, I love this mod!  :D :D :D
Title: Re: Recent posts user preference
Post by: miguelito on June 17, 2008, 08:07:09 PM
Quote from: miseryshining on June 15, 2008, 12:03:14 PM
new version posted:

-3.00 adds support for 2.0 beta 3.*, admin settings are moved to configuration->modifications.

please test! (quite some under the hood changes..)

packages installed:
Alias boards
single category.

default theme.

I tried to installl this mod(recent post)

admin link exist, but nothing appears
user profile link exist, and be able to make changes in his config.
also index.php  died:

Fatal error: require_once() [function.require]: Failed opening required '/home/mydir/public_html/foro/Sources/SSI.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/mydir/public_html/foro/Sources/Load.php on line 2252

some help??
i do need this mod , thanks :D
Title: Re: Recent posts user preference
Post by: miseryshining on June 18, 2008, 06:36:04 AM
Quote from: miguelito on June 17, 2008, 08:07:09 PM
Quote from: miseryshining on June 15, 2008, 12:03:14 PM
new version posted:

-3.00 adds support for 2.0 beta 3.*, admin settings are moved to configuration->modifications.

please test! (quite some under the hood changes..)

packages installed:
Alias boards
single category.

default theme.

I tried to installl this mod(recent post)

admin link exist, but nothing appears
user profile link exist, and be able to make changes in his config.
also index.php  died:

Fatal error: require_once() [function.require]: Failed opening required '/home/mydir/public_html/foro/Sources/SSI.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/mydir/public_html/foro/Sources/Load.php on line 2252

some help??
i do need this mod , thanks :D


you're on beta3?
did you include SSI_recentPostsPrefs() somewhere in your templates? got any errors during install?
Title: Re: Recent posts user preference
Post by: miguelito on June 18, 2008, 08:04:09 AM
hi, thanks for your fast response.

It´s a  beta 3.1, quite clean installation, only migrated the data to the new database.

i´m triyng it with  default theme, not touched yet. ( waiting for beta4 to start with it )

No prob installing.

Only have the 2 mods i wrote:alias boards and single category.

I did not touch the templates. only run the install from the admin panel. Do I miss something??

thanks.
sorry for my english, i´m from Spain.


Title: Re: Recent posts user preference
Post by: miseryshining on June 21, 2008, 09:15:48 PM
Quote from: miguelito on June 18, 2008, 08:04:09 AM
hi, thanks for your fast response.

It´s a  beta 3.1, quite clean installation, only migrated the data to the new database.

i´m triyng it with  default theme, not touched yet. ( waiting for beta4 to start with it )

No prob installing.

Only have the 2 mods i wrote:alias boards and single category.

I did not touch the templates. only run the install from the admin panel. Do I miss something??

thanks.
sorry for my english, i´m from Spain.




Thanks for your feedback, i just released a new version that should fix both problems:

-3.01 fixes a major bug when using a recent posts list on the board index. It also fixes the admin settings not displaying.
Title: Re: Recent posts user preference
Post by: msvdm on June 22, 2008, 05:18:13 AM
Hi i uss 2.0 Beta 3.1 Public
when i try to install the mod i get this error :

An Error Has Occurred!
The package you are trying to download or install is either corrupt or not compatible with this version of SMF. 
Title: Re: Recent posts user preference
Post by: evil-angelist on June 22, 2008, 06:40:30 AM
It seems to be the same on 1.1.5 as well. Lets hope this gets fixed soon ;)

Quote from: msvdm on June 22, 2008, 05:18:13 AM
Hi i uss 2.0 Beta 3.1 Public
when i try to install the mod i get this error :

An Error Has Occurred!
The package you are trying to download or install is either corrupt or not compatible with this version of SMF. 

Title: Re: Recent posts user preference
Post by: miseryshining on June 22, 2008, 05:55:37 PM
Quote from: evil-angelist on June 22, 2008, 06:40:30 AM
It seems to be the same on 1.1.5 as well. Lets hope this gets fixed soon ;)

Quote from: msvdm on June 22, 2008, 05:18:13 AM
Hi i uss 2.0 Beta 3.1 Public
when i try to install the mod i get this error :

An Error Has Occurred!
The package you are trying to download or install is either corrupt or not compatible with this version of SMF. 


Apparently SMF doesnt like the zipfiles that are created on my Linux distribution.. Its now replaced with a tar.gz package.
Title: Re: Recent posts user preference
Post by: miguelito on June 23, 2008, 07:07:43 AM
Quote from: miseryshining on June 21, 2008, 09:15:48 PM
Quote from: miguelito on June 18, 2008, 08:04:09 AM
hi, thanks for your fast response.

It´s a  beta 3.1, quite clean installation, only migrated the data to the new database.

i´m triyng it with  default theme, not touched yet. ( waiting for beta4 to start with it )
No prob installing.

Only have the 2 mods i wrote:alias boards and single category.

I did not touch the templates. only run the install from the admin panel. Do I miss something??

thanks.
sorry for my english, i´m from Spain.




Thanks for your feedback, i just released a new version that should fix both problems:

-3.01 fixes a major bug when using a recent posts list on the board index. It also fixes the admin settings not displaying.

works like a charm...
great work.

i´m traslating to spanish
Title: Re: Recent posts user preference
Post by: miseryshining on June 23, 2008, 07:21:29 AM
Quote from: miguelito on June 23, 2008, 07:07:43 AM
Quote from: miseryshining on June 21, 2008, 09:15:48 PM
Quote from: miguelito on June 18, 2008, 08:04:09 AM
hi, thanks for your fast response.

It´s a  beta 3.1, quite clean installation, only migrated the data to the new database.

i´m triyng it with  default theme, not touched yet. ( waiting for beta4 to start with it )
No prob installing.

Only have the 2 mods i wrote:alias boards and single category.

I did not touch the templates. only run the install from the admin panel. Do I miss something??

thanks.
sorry for my english, i´m from Spain.




Thanks for your feedback, i just released a new version that should fix both problems:

-3.01 fixes a major bug when using a recent posts list on the board index. It also fixes the admin settings not displaying.

works like a charm...
great work.

i´m traslating to spanish


good! You can send me the Spanish files / strings if you want me to include em.
Title: Re: Recent posts user preference
Post by: samy.3660 on June 26, 2008, 04:06:13 AM
hi,
I have installed the latest version on my board 2.0 beta 3.1. But i cannot see a block for recent threads??
I am noob in php can you guide me in simple language.
Title: Re: Recent posts user preference
Post by: miseryshining on June 26, 2008, 07:21:52 AM
you should enable it in your theme settings (in your forum administration section). or add a block to your theme in the template files using this code:


require_once('location/to/SSI.php');
if (function_exists('ssi_recentPostsPref')) ssi_recentPostsPref();


Replace the 'location/to' with the path to your SSI.php. Read the theming docs (http://docs.simplemachines.org/index.php?board=34.0;sort=subject) if you want to learn where to place this.
Title: Re: Recent posts user preference
Post by: Cowboysfan4life on June 26, 2008, 06:29:46 PM
Hello everyone I'm a newbie but i will like to get the recent post to show up on the front of my website. My website url is http://cfaleague.com and my forum is http://cfaleague.com/forums . I want to display the recent post under Around the league on my homepage. Can anyone help me? I love simple machines forum and I don't want to switch to phpbb to get it to work.  Thanks in advance
Title: Re: Recent posts user preference
Post by: miseryshining on June 26, 2008, 06:43:39 PM
look at SMF docs (http://docs.simplemachines.org/index.php?topic=400.msg529#msg529) for your answer. Off course you can also load ssi_recentPostsPref() if you have my mod installed.
Title: Re: Recent posts user preference
Post by: Cowboysfan4life on June 27, 2008, 02:30:32 AM
Ok i installed your mod and I think I have everything working. I added the code to the index.php and everything seems fine but nothing is being displayed. The site uses a template made of .tpl files. What do I insert in the index.tpl file to get it to show on the front page?
Title: Re: Recent posts user preference
Post by: miseryshining on June 27, 2008, 03:59:15 AM
Quote from: Cowboysfan4life on June 27, 2008, 02:30:32 AM
Ok i installed your mod and I think I have everything working. I added the code to the index.php and everything seems fine but nothing is being displayed. The site uses a template made of .tpl files. What do I insert in the index.tpl file to get it to show on the front page?

Uhhh, you probably need to find out how to put php snippets inside the tpl files, if that's possible at all ;). You should ask that question elsewhere though..
Title: Re: Recent posts user preference
Post by: Cowboysfan4life on June 27, 2008, 05:59:16 AM
Ok it's working now. Is there a way to show avators for the latest post?
Title: Re: Recent posts user preference
Post by: miseryshining on June 27, 2008, 09:54:09 AM
Quote from: Cowboysfan4life on June 27, 2008, 05:59:16 AM
Ok it's working now. Is there a way to show avators for the latest post?

Quote from: Cowboysfan4life on June 27, 2008, 05:59:16 AM
Ok it's working now. Is there a way to show avators for the latest post?

I don't know, search the mod section. This is not the right place to ask for generic SMF support btw.
Title: Re: Recent posts user preference
Post by: samy.3660 on June 28, 2008, 03:37:14 AM
Quote from: miseryshining on June 26, 2008, 07:21:52 AM
you should enable it in your theme settings (in your forum administration section). or add a block to your theme in the template files using this code:


require_once('location/to/SSI.php');
if (function_exists('ssi_recentPostsPref')) ssi_recentPostsPref();


Replace the 'location/to' with the path to your SSI.php. Read the theming docs (http://docs.simplemachines.org/index.php?board=34.0;sort=subject) if you want to learn where to place this.

Where is template file located please guide in detail.
Title: Re: Recent posts user preference
Post by: samy.3660 on June 28, 2008, 08:23:12 AM
Got it myself thanks!!!
Title: Re: Recent posts user preference
Post by: ssufian on July 02, 2008, 01:57:00 AM
I've installed Recent posts user preference version 3.01 into my SMF Default theme version 1.1.5 but I can't see Recent Post like what you put in your screenshot in the Mod page http://custom.simplemachines.org/mods/index.php?mod=654

Please advise... I'm still new, noob, fresh in SMF...
Title: Re: Recent posts user preference
Post by: miseryshining on July 02, 2008, 03:59:30 AM
Quote from: ssufian on July 02, 2008, 01:57:00 AM
I've installed Recent posts user preference version 3.01 into my SMF Default theme version 1.1.5 but I can't see Recent Post like what you put in your screenshot in the Mod page http://custom.simplemachines.org/mods/index.php?mod=654

Please advise... I'm still new, noob, fresh in SMF...

if you want em to display on the board index, go to your administration panel, then go to the settings for the default theme and change "Number of recent posts to display on board index:" to a number.
Title: Re: Recent posts user preference
Post by: romper on July 07, 2008, 04:42:06 PM
I tried to read all 14 pages but lost concentration, so if someone answered this question, I'm sorry....I did everything and I see block, they are nice, I can modify them and all, but my question is, can i move the block on te right or left side, not bellow forum index?
THX!
Title: Re: Recent posts user preference
Post by: miseryshining on July 08, 2008, 03:33:25 AM
Quote from: romper on July 07, 2008, 04:42:06 PM
I tried to read all 14 pages but lost concentration, so if someone answered this question, I'm sorry....I did everything and I see block, they are nice, I can modify them and all, but my question is, can i move the block on te right or left side, not bellow forum index?
THX!

Your answer is a little bit above (http://www.simplemachines.org/community/index.php?topic=158917.msg1592489#msg1592489)! You will have to learn how theming works if you want to do these type of things.
Title: Re: Recent posts user preference
Post by: lobokun on July 14, 2008, 08:36:40 PM
hello im running
1.1.5
and i installed the latest
mod
recentPosts_301
and my question is how would i get to get my show recent topics like this
(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fimg211.imageshack.us%2Fimg211%2F6656%2Findexcm2.jpg&hash=9700ecc1ca4e8e2e12a88e58bfbfbaedceffff53)
Title: Re: Recent posts user preference
Post by: miseryshining on July 15, 2008, 03:52:44 AM
Quote from: lobokun on July 14, 2008, 08:36:40 PM
hello im running
1.1.5
and i installed the latest
mod
recentPosts_301
and my question is how would i get to get my show recent topics like this
(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fimg211.imageshack.us%2Fimg211%2F6656%2Findexcm2.jpg&hash=9700ecc1ca4e8e2e12a88e58bfbfbaedceffff53)

thats the recent topics page. you can get it by going to http://www.yourforum.com/index.php?action=recenttopics
Title: Re: Recent posts user preference
Post by: KD4FBI on August 12, 2008, 09:10:14 PM
Will this mod work with the "Simple Portal" mod?
I would like to be able to show the custom block for Recent Posts to show as one of the blocks in the Simple Portal but don't know how.
Simple Portal says it will show the recent posts and recent topics blocks, but it doesn't show the user's preferences in those blocks, just the last X number of posts/topics. With Simple Portal, I can set up "specialized" blocks using html, php or bbc, so I'm thinking I may be able to use one of those blocks to show the info for the Recent Posts mod. I just don't know how or what should go into them.
I am definitely NOT a programmer, so "dummies" version of help will be greatly appreciated.

Thanks in advance,
Mickey
Title: Re: Recent posts user preference
Post by: Nathaniel on August 15, 2008, 05:01:55 AM
There is a bug with this mod, for SMF 2 Beta. On line 794 of the 'RP_2.mod' file, in the 'RecentTopics()' function which is added to the 'Recent.php' source file. It occurs in the "recentPosts_301.tar.gz" package. ;)

This Code:
         AND b.id_boardNOT IN (" . implode(', ', $exclude_boards) . ")") . (!empty($include_boards) ? "

Should be replaced with this code:
         AND b.id_board NOT IN (" . implode(', ', $exclude_boards) . ")") . (!empty($include_boards) ? "


The 'b.id_boardNOT' part, returns db errors.

Read the topic below for reference:
http://www.simplemachines.org/community/index.php?action=post2
Title: Re: Recent posts user preference
Post by: KD4FBI on August 17, 2008, 04:24:23 PM
I looked through this thread and couldn't find what I need to know.
I am using SMF 1.1.5, UserCP 2.0, Recent Posts user preference 3.01. The Recent Posts mod installed fine, I know I need to add the code that calls the SSI function. In the thread, I keep seeing people saying to put the code where ever you want the box to show, but I have NO clue which template file to even start to look at.
I would like the box for the recent posts that the user selects to be shown either on the front page or in their profile - whichever one will be easiest to do.
I am definitely not a programmer by any stretch of the imagination (and my imagination is pretty wild), so a "dummies" version of help is greatly appreciated.

Thanks in advance,
Mickey
Title: Re: Recent posts user preference
Post by: miseryshining on August 19, 2008, 05:57:06 PM
Quote from: KD4FBI on August 12, 2008, 09:10:14 PM
Will this mod work with the "Simple Portal" mod?
I would like to be able to show the custom block for Recent Posts to show as one of the blocks in the Simple Portal but don't know how.
Simple Portal says it will show the recent posts and recent topics blocks, but it doesn't show the user's preferences in those blocks, just the last X number of posts/topics. With Simple Portal, I can set up "specialized" blocks using html, php or bbc, so I'm thinking I may be able to use one of those blocks to show the info for the Recent Posts mod. I just don't know how or what should go into them.
I am definitely NOT a programmer, so "dummies" version of help will be greatly appreciated.

Thanks in advance,
Mickey

it will work if it allows you to add php code in a block. just use


require_once('location/to/SSI.php');
if (function_exists('ssi_recentPostsPref')) ssi_recentPostsPref();


You could have also found this in the opening post which describes exactly how to make things work.

Quote from: LHVWB on August 15, 2008, 05:01:55 AM
There is a bug with this mod, for SMF 2 Beta. On line 794 of the 'RP_2.mod' file, in the 'RecentTopics()' function which is added to the 'Recent.php' source file. It occurs in the "recentPosts_301.tar.gz" package. ;)

This Code:
         AND b.id_boardNOT IN (" . implode(', ', $exclude_boards) . ")") . (!empty($include_boards) ? "

Should be replaced with this code:
         AND b.id_board NOT IN (" . implode(', ', $exclude_boards) . ")") . (!empty($include_boards) ? "


The 'b.id_boardNOT' part, returns db errors.

Read the topic below for reference:
http://www.simplemachines.org/community/index.php?action=post2

thanks for resolving that, i posted a new package with the fix included.

Quote from: KD4FBI on August 17, 2008, 04:24:23 PM
I looked through this thread and couldn't find what I need to know.
I am using SMF 1.1.5, UserCP 2.0, Recent Posts user preference 3.01. The Recent Posts mod installed fine, I know I need to add the code that calls the SSI function. In the thread, I keep seeing people saying to put the code where ever you want the box to show, but I have NO clue which template file to even start to look at.
I would like the box for the recent posts that the user selects to be shown either on the front page or in their profile - whichever one will be easiest to do.
I am definitely not a programmer by any stretch of the imagination (and my imagination is pretty wild), so a "dummies" version of help is greatly appreciated.

Thanks in advance,
Mickey

You will have to read a bit about how theming works for SMF. I posted a link to some articles in the help section a few pages back in this topic. Look in the opening post for detailed instructions on how you can integrate the recent posts list.
Title: Re: Recent posts user preference
Post by: et10yl on August 22, 2008, 01:09:35 PM
Great mod! Thanks!

Not sure if someone else has already done this, but I edited my Recent.template.php so that it would have a dropdown where users could select to see Recent Topics.

Attaching 2 screenshots.

Before running the Recent Topics search, note the added form on the right of the screen for selecting days worth of topics

After running Recent Topics search, note the text display under the link tree disclaiming that these are all the topics posted in the last X days.


Basically, my edits to Recent.Template.php are as follows:

         <td>', theme_linktree(), '</td>

Replace "</td>" with


<!-- start: Addition to show last "X" days worth of topics"-->';
if($_POST["action"]=="recenttopics"){
echo '
<span class="middletext" style="font-weight:bold;">
<BR>Now displaying ALL topics (read or unread) in the last '.$_POST["limit"].' day(s).
<BR>To get back to seeing just the unread topics, <a href="index.php?action=unread">click here</a>
<BR><BR>
</span>
<!-- end: Addition to show last "X" days worth of topics"-->';
}
echo '
</td>
<!-- start: Addition to show last "X" days worth of topics"-->
<td align="right">
<table border=0 class="middletext" style="font-weight:bold;">
<tr>
<td>Recent Topics in the last</td>
<td>
<form action="index.php" method="POST">
<select name="limit">
<option value=1>1</option>
<option value=2>2</option>
<option value=3>3</option>
</select>
<input type="hidden" name="action" value="recenttopics">
</td>
<td>days</td>
</tr>
<tr>
<td valign="middle" colspan=3>
<input type="submit" value="submit">
</form></td>
</tr></table>
</td>
<!-- end: Addition to show last "X" days worth of topics"-->
Title: Re: Recent posts user preference
Post by: miseryshining on August 22, 2008, 01:43:09 PM
Nice addition indeed, i added it under 'hacks' in the first post of this topic. Thanks for posting it here!
Title: Re: Recent posts user preference
Post by: et10yl on August 22, 2008, 02:20:23 PM
^^ thanks! :) and you're welcome... it's my first real post that could be useful to others here. the rest of my posts so far have been questions (so i think) :D feels good to be able to "give back." thanks again for the awesome mod.
Title: Re: Recent posts user preference
Post by: Nequil on August 29, 2008, 05:42:17 PM
Hi,

I have a little problem, how I can separated (add space) name of topic from page numbers?

(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fimg257.imageshack.us%2Fimg257%2F5088%2Fhelpjz3.png&hash=d7b015e926ca784343c8e291111d3e2137d5344c)

thanks for help.
Title: Re: Recent posts user preference
Post by: miseryshining on September 01, 2008, 03:28:21 PM
Quote from: Nequil on August 29, 2008, 05:42:17 PM
Hi,

I have a little problem, how I can separated (add space) name of topic from page numbers?

(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fimg257.imageshack.us%2Fimg257%2F5088%2Fhelpjz3.png&hash=d7b015e926ca784343c8e291111d3e2137d5344c)

thanks for help.

you'll probably have to edit the stylesheet of your theme (and give the left column a fixed width).
Title: Re: Recent posts user preference
Post by: tasorli on September 08, 2008, 11:10:58 AM
Hi..

I installed this package, but want to uninstall it.. When i press "Uninstall" from admin-area, I get this error message:

This package cannot be uninstalled, because there is no uninstaller!

Please contact the mod author for more information. 

Is there a way of uninstalling "Recent Post User Interface"?
Title: Re: Recent posts user preference
Post by: miseryshining on September 08, 2008, 12:03:06 PM
Quote from: tasorli on September 08, 2008, 11:10:58 AM
Hi..

I installed this package, but want to uninstall it.. When i press "Uninstall" from admin-area, I get this error message:

This package cannot be uninstalled, because there is no uninstaller!

Please contact the mod author for more information. 

Is there a way of uninstalling "Recent Post User Interface"?

what version of SMF are you using?
Title: Re: Recent posts user preference
Post by: tasorli on September 08, 2008, 02:30:25 PM
I'm sorry..

I'm using version 1.1.6.

http://www.norskfilmforum.com
Title: Re: Recent posts user preference
Post by: miseryshining on September 08, 2008, 02:37:50 PM
Quote from: tasorli on September 08, 2008, 02:30:25 PM
I'm sorry..

I'm using version 1.1.6.

http://www.norskfilmforum.com

the mod doesnt support 1.1.6 officially, so that's why it tells you it lacks uninstall information. I assume you installed it on an earlier version of SMF and upgraded later?

I'd advise to uninstall the 1.1.6 upgrade package from the package manager, then uninstall the recent posts mod, then reinstall the 1.1.6 package.

By the way, did you run into any problems using it on 1.1.6?
Title: Re: Recent posts user preference
Post by: tasorli on September 08, 2008, 02:47:11 PM
No, non problems with 1.1.6 so far.. (If you don't count this in as a problem). :)

Thank you for your're advice. I will try it.
Title: Re: Recent posts user preference
Post by: Nequil on September 16, 2008, 11:36:54 AM
please update this mod to 1.1.6 smf version!
Title: Re: Recent posts user preference
Post by: ellion on September 19, 2008, 01:37:21 PM
does this work with smf1.1.6
Title: Re: Recent posts user preference
Post by: Nequil on September 20, 2008, 12:21:02 PM
1.

Quote
Hi,

I have a little problem, how I can separated (add space) name of topic from page numbers?

(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fimg257.imageshack.us%2Fimg257%2F5088%2Fhelpjz3.png&hash=d7b015e926ca784343c8e291111d3e2137d5344c)

Quotemiseryshining: you'll probably have to edit the stylesheet of your theme (and give the left column a fixed width).

problem fixed:

find in Recent.template.php:
<img src="' . $settings['images_url'] . '/icons/show_sticky.gif" align="right" alt="" style="margin: 0;" />' : '', $topic['first_post']['link'], $topic['is_read'] == 0 ? ' <a href="'. $topic['new_href']. '"><img src="'. $settings['images_url']. '/'. $context['user']['language']. '/new.gif" alt="'. $txt[302]. '" /></a>' : '', '<span class="smalltext">', $topic['pages'], ' ', $txt['smf88'], ' ', $topic['board']['link'], '</span></td>

replace:
<img src="' . $settings['images_url'] . '/icons/show_sticky.gif" align="right" alt="" style="margin: 0;" />' : '', $topic['first_post']['link'], $topic['is_read'] == 0 ? ' <a href="'. $topic['new_href']. '"><img src="'. $settings['images_url']. '/'. $context['user']['language']. '/new.gif" alt="'. $txt[302]. '" /></a>' : '', ' <span class="smalltext">', $topic['pages'], ' ', $txt['smf88'], ' ', $topic['board']['link'], '</span></td>

2.
ok... so I did a litlle update to smf 1.1.6 (mod in attach).
Title: Re: Recent posts user preference
Post by: ellion on September 25, 2008, 05:27:36 PM
i have tried a couple of times to install this and i keep encountering the same problem.

the package will install correctly with no errors, when i view the recent topics page i get a small box giving me an error message about the recent.template (or recent.php i am not sure which it was now)

any ideas what might be wrong.
Title: Re: Recent posts user preference
Post by: Marcuss on October 03, 2008, 06:03:09 AM
Hi!  :)
for the installation on 1.1.6 i can use the manual installation instructions for the 1.1.5?

thank u

Title: Re: Recent posts user preference
Post by: Marcuss on October 04, 2008, 04:45:05 AM
please, help! :)
Title: Re: Recent posts user preference
Post by: vietravel247.com on October 09, 2008, 11:23:55 AM
Quote from: tasorli on September 08, 2008, 02:30:25 PM
I'm sorry..

I'm using version 1.1.6.

http://www.norskfilmforum.com
Me too.
I install(manual) version 3.02 but I can't change option.  When I click on " Recent posts/topics" its not show to change opion(view my attach picture).
Please help me. Thank you very much.     
Title: Re: Recent posts user preference
Post by: miseryshining on November 06, 2008, 04:23:20 PM
Mod is updated!

3.03:  minor update to support SMF 1.1.6 and 2 beta 4.
Title: Re: Recent posts user preference
Post by: miseryshining on November 07, 2008, 10:51:41 AM
Quote from: vietravel247.com on October 09, 2008, 11:23:55 AM
Quote from: tasorli on September 08, 2008, 02:30:25 PM
I'm sorry..

I'm using version 1.1.6.

http://www.norskfilmforum.com
Me too.
I install(manual) version 3.02 but I can't change option.  When I click on " Recent posts/topics" its not show to change opion(view my attach picture).
Please help me. Thank you very much.     


can you check if it prints anything in the error log?
Title: Re: Recent posts user preference
Post by: happyfeet on November 10, 2008, 05:05:47 PM
I am using SMF 1.1.7, TP 0.98 and have version 3.04 of this mod installed. Using either my Administrator or general user test accounts, I receive the following error when selecting Profile - Modify Profile - Recent Posts and Preferences:

" Unable to load the 'recentPosts' template. "

I have "Enable extra user preferences for recent post blocks" enabled (checked) in the Configuration - Features and Options - Recent Posts/Topics section.

I used the package installer feature to load this mod into my site, in which all install tests were successful. I have extracted the recentposts_304.tar.gz file and validated all merge steps in RP.mod were installed correctly.

Any ideas?
Title: Re: Recent posts user preference
Post by: miseryshining on November 10, 2008, 05:43:51 PM
Quote from: happyfeet on November 10, 2008, 05:05:47 PM
I am using SMF 1.1.7, TP 0.98 and have version 3.04 of this mod installed. Using either my Administrator or general user test accounts, I receive the following error when selecting Profile - Modify Profile - Recent Posts and Preferences:

" Unable to load the 'recentPosts' template. "

I have "Enable extra user preferences for recent post blocks" enabled (checked) in the Configuration - Features and Options - Recent Posts/Topics section.

I used the package installer feature to load this mod into my site, in which all install tests were successful. I have extracted the recentposts_304.tar.gz file and validated all merge steps in RP.mod were installed correctly.

Any ideas?

If everything is installed correctly it should work (I tested it on 1.1.7). Do you have other (profile) mods installed? Do the other profile preferences still function like they should? Maybe you can post your Profile.template.php so i can take a look.
Title: Re: Recent posts user preference
Post by: happyfeet on November 10, 2008, 06:01:45 PM
OK, so I am embarrased to say why this was not working. Let's just say that if you are using a custom theme, to check the custom theme folder and make sure that copy of profile.template.php contains the necessary code. My bad!

DOH!  ;D
Title: Re: Recent posts user preference
Post by: miseryshining on November 11, 2008, 06:55:51 AM
Quote from: happyfeet on November 10, 2008, 06:01:45 PM
OK, so I am embarrased to say why this was not working. Let's just say that if you are using a custom theme, to check the custom theme folder and make sure that copy of profile.template.php contains the necessary code. My bad!

DOH!  ;D

Didn't think of that one yet ;) Good thing they tackled that (mostly) for SMF 3 (which will try to install in all installed themes).
Title: Re: Recent posts user preference
Post by: JaGuR on November 17, 2008, 09:43:55 AM
Having some troubles here, been a long time since upgrading this mod ..... any way decided to upgrade it , but I am missing the admins settings, I have the link to Features and Options > Recent posts/topics , but when I click on it it only gives me the basic features page and the  Recent posts/topics doesn't open up

I manually installed it because I my website is heaviy modded so I may hae missed something .... any idea's ??

Also limit days are not working.

Link to site and mod
http://www.racehorsetalk.com.au/index.php?action=recenttopics;

http://www.racehorsetalk.com.au/index.php


Cheers
Title: Re: Recent posts user preference
Post by: miseryshining on November 17, 2008, 11:11:33 AM
Quote from: JaGuR on November 17, 2008, 09:43:55 AM
Having some troubles here, been a long time since upgrading this mod ..... any way decided to upgrade it , but I am missing the admins settings, I have the link to Features and Options > Recent posts/topics , but when I click on it it only gives me the basic features page and the  Recent posts/topics doesn't open up

I manually installed it because I my website is heaviy modded so I may hae missed something .... any idea's ??

Also limit days are not working.

Link to site and mod
http://www.racehorsetalk.com.au/index.php?action=recenttopics;

http://www.racehorsetalk.com.au/index.php


Cheers

You probably didn' t apply some changes to your recent.template and the /Sources/ModSettings.php
Title: Re: Recent posts user preference
Post by: JaGuR on November 17, 2008, 05:02:58 PM
Never mind fixed it  ;D

This has come a long way since last time I used it MS, love the time limit
Title: Re: Recent posts user preference
Post by: JaGuR on November 18, 2008, 05:55:05 AM
OK, time to put back, here is a HACK for the dropdown menu HACK,

a Hack for a Hack  ;)

Displays the number of days selected in the drop down box, if you selected to show 3 days, then instead displaying 1 in the dropdown box it will display3 ...  your last selection.

<form action="index.php?action=recenttopics" method="POST">
<select name="limit">
<option value=1 ' . ($_POST['limit']==1 ? 'selected' : '') . '>1</option>
<option value=2 ' . ($_POST['limit']==2 ? 'selected' : '') . '>2</option>
<option value=3 ' . ($_POST['limit']==3 ? 'selected' : '') . '>3</option>
<option value=5 ' . ($_POST['limit']==5 ? 'selected' : '') . '>5</option>
<option value=10 ' . ($_POST['limit']==10 ? 'selected' : '') . '>10</option>
<option value=30 ' . ($_POST['limit']==30 ? 'selected' : '') . '>30</option>
<option value=50 ' . ($_POST['limit']==50 ? 'selected' : '') . '>50</option>
<option value=100 ' . ($_POST['limit']==100 ? 'selected' : '') . '>100</option>
<option value=300 ' . ($_POST['limit']==300 ? 'selected' : '') . '>300</option>
</select>
<input type="hidden" name="action" value="recenttopics">
</td>
Title: Re: Recent posts user preference
Post by: miseryshining on November 25, 2008, 04:56:01 PM
Quote from: JaGuR on November 17, 2008, 05:02:58 PM
Never mind fixed it  ;D

This has come a long way since last time I used it MS, love the time limit

thanks! (also for sharing your contributions)
Title: Re: Recent posts user preference
Post by: mcatto on January 08, 2009, 04:45:48 PM
Hi.
Why i hace this error in the installation???
I have SMF 1.1.7 and Recent posts user preference 3.04

1. Execute Modification RP_db.php 
2. Execute Modification .//Themes/default/languages/Profile.english.php Éxito
3. Execute Modification .//Themes/default/languages/ModSettings.english.php Éxito
4. Execute Modification .//Themes/default/languages/index.english.php Éxito
5. Execute Modification .//Sources/Load.php Éxito
6. Execute Modification .//SSI.php Éxito
7. Execute Modification .//Sources/Profile.php Éxito
8. Execute Modification .//Themes/default/Profile.template.php Éxito
9. Execute Modification .//Sources/Recent.php Éxito
10. Execute Modification .//Themes/default/Recent.template.php Test failed
11. Execute Modification .//Sources/BoardIndex.php Éxito
12. Execute Modification .//index.php Éxito
13. Execute Modification .//Sources/ModSettings.php Éxito


Title: Re: Recent posts user preference
Post by: b4pjoe on January 11, 2009, 04:08:33 PM
I'm using SMF 2.0 beta 4 with the Recent posts & topics 3.04 mod installed. I get 2 PHP errors if I click on any of the pages in the admin panel "Configuration:Features & Options. All of them give the same PHP errors:


8: Undefined index: recentposts_title
Apply Filter: Only show the errors from this file
File: /home/content/b/4/p/b4printadmin/html/forums/Sources/ManageSettings.php
Line: 136

8: Undefined index: label
File: /home/content/b/4/p/b4printadmin/html/forums/Themes/default/GenericMenu.template.php (generic_menu_dropdown_above sub template - eval?)
Line: 308


Any ideas?
Title: Re: Recent posts user preference
Post by: hangyong on January 15, 2009, 01:06:00 AM
Hi all,

hope you can give me some pointers as my setup does not seem to be working.

I installed 3.04 on SMF1.17, the files tested ok, and all went well installing.

All the settings were done from within SMF's admin interface, and user settings were also performed.

However, on the board index, where it says "view the most recent posts in the forum", the URL is stuck at "./index.php?action=recent". It also goes to the standard recent post page.

(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fwww.filmgrain.com%2Fforumpics%2Frecent.png&hash=3bdedc67775677ca8fb2081e71ba64399e43b8f3)

(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fwww.filmgrain.com%2Fforumpics%2Frecent1.png&hash=c6c3088973613a8c166ddea35332de0bb345bc51)

When I manually enter "./index.php?action=recenttopics", everything works fine.

(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fwww.filmgrain.com%2Fforumpics%2Frecent2.png&hash=a80ee60b9bbc9358b48f22d9fb958542acffebd6)

Anyone can tell me what went wrong and how to solve it?

Title: Re: Recent posts user preference
Post by: chrishicks on February 09, 2009, 11:43:23 PM
does this work on 1.1.8?
Title: Re: Recent posts user preference
Post by: neddim on February 11, 2009, 03:35:24 PM
No it does not. I ve tried, but it says it is incompatible with 1-1-8 version.
Hope so, someone would make needed changes to make it work with new SMF version.
It is the best recent post mod, cause it has a member selection options function.
Title: Re: Recent posts user preference
Post by: Lotti on March 16, 2009, 05:52:07 PM
how i can show the post only of one or two boards from ssi_recentTopics()? i try but...
Title: Re: Recent posts user preference
Post by: Lotti on March 20, 2009, 04:32:30 PM
sorry but, no reply to me?
Title: Re: Recent posts user preference
Post by: miseryshining on April 17, 2009, 07:38:52 PM
Sorry everyone, i must have missed the automatic thread update notification some time ago.

@mau77: you probably have a mod installed that already changed a file. uninstall all mods and then try to reinstall it.
@joec88: will fix those in the next version. They are non-critical btw, won't break anything. 
@hangyong: it doesn't replace the recent posts link. If you want to change it you should edit the corresponding template file.
@neddim: update is coming
@lotti: did you try this? (you have to replace the board numbers with the one you want to show):

www.yourforumname.com/index.php?action=recenttopics;boards=1,2


Title: Re: Recent posts user preference
Post by: WVPreacher on April 18, 2009, 02:07:29 PM
Thank You for the coming update Misery Shining.  I love this mod and miss it. :)
Title: Re: Recent posts user preference
Post by: miseryshining on April 18, 2009, 11:13:30 PM
Quote from: WVPreacher on April 18, 2009, 02:07:29 PM
Thank You for the coming update Misery Shining.  I love this mod and miss it. :)

done, go get it! - Thanks for the kudos :)

Quote-3.06 is a minor update to support SMF 1.1.8 and 2 rc1.
Title: Re: Recent posts user preference
Post by: sAce on April 19, 2009, 11:15:21 AM
dude, the 3.06 is not woking wid 118, its not even uploading or parsing
Title: Re: Recent posts user preference
Post by: Mick. on April 19, 2009, 12:40:35 PM
Quote from: sbmcos on April 19, 2009, 11:15:21 AM
dude, the 3.06 is not woking wid 118, its not even uploading or parsing

Yep.  Same here.
Title: Re: Recent posts user preference
Post by: Tanks on April 19, 2009, 01:04:18 PM
Tried to install on 2.0 RC1 but this does not show up in the package manager.

Any advice ?
Title: Re: Recent posts user preference
Post by: miseryshining on April 20, 2009, 05:38:01 PM
File unpacks fine on a mac, you could have unpacked it and drop the directory in the Packages dir.

I just uploaded a new package in tgz format, please try again. 
Title: Re: Recent posts user preference
Post by: ellion on April 27, 2009, 07:48:16 AM
i have a problem that i think is related to this mod.

any category that i create is not included in recent topics block at bottom of page and not included on page ?action=recenttopics;boards=all

i think that boards created after this mod was installed are not picked up by this mod. woudl that be the case and if so how coudl i fix this?
Title: Re: Recent posts user preference
Post by: miseryshining on April 28, 2009, 05:10:25 PM
Quote from: ellion on April 27, 2009, 07:48:16 AM
i have a problem that i think is related to this mod.

any category that i create is not included in recent topics block at bottom of page and not included on page ?action=recenttopics;boards=all

i think that boards created after this mod was installed are not picked up by this mod. woudl that be the case and if so how coudl i fix this?

Are you sure that permissions are set correctly? Do you have custom boards selected in the profile preferences?
Title: Re: Recent posts user preference
Post by: ellion on April 28, 2009, 05:41:51 PM
i am not sure, i have looked through all the settings and permissions that i thought might be realted but i am not sure if there is anything that would prevent a board being included in recent topics. ???
Title: Re: Recent posts user preference
Post by: ellion on April 28, 2009, 05:51:01 PM
Quote from: miseryshining on April 28, 2009, 05:10:25 PM
Are you sure that permissions are set correctly? Do you have custom boards selected in the profile preferences?
i have noticed that there are settings in my user profile but would this only apply to my profile so that every member would have to manually opt in to any new boar4s that where created?
Title: Re: Recent posts user preference
Post by: miseryshining on May 01, 2009, 11:28:35 PM
Quote from: ellion on April 28, 2009, 05:51:01 PM
Quote from: miseryshining on April 28, 2009, 05:10:25 PM
Are you sure that permissions are set correctly? Do you have custom boards selected in the profile preferences?
i have noticed that there are settings in my user profile but would this only apply to my profile so that every member would have to manually opt in to any new boar4s that where created?

If nothing is ticked it will show posts/topics from all boards that are accessible for the user. Once the user ticks one or more boards it will only show content from these boards for that individual user.

You can always override the user preference by adding boards=1,2,6 (http://www.yourforum.com/index.php?action=recenttopics;boards=1,2,6)

Or if you are using it in a block somewhere:
ssi_recentPostsPref(null,'1,2,6');

can you give me a link to your forum so i can take a look?
Title: Re: Recent posts user preference
Post by: ellion on May 03, 2009, 12:18:23 PM
QuoteIf nothing is ticked it will show posts/topics from all boards that are accessible for the user. Once the user ticks one or more boards it will only show content from these boards for that individual user.

this was the reason for the problem i had selected [check all] before i created new categories.  everything is working ok now, i think.

by board is at http://psychologyforum.us

thanks for your help.  :D
Title: Re: Recent posts user preference
Post by: Bjuan on May 20, 2009, 08:23:58 PM
Hello!

I would like to use this add-on on version 1.1.8 .
After installing it, I get the following error message when I click on "Show unread posts since last visit." "Show new replies to your posts." or "View the most recent posts on the forum." -->

Fatal error: Cannot redeclare recenttopics() (previously declared in /home2/feet/public_html/Sources/Recent.php:3) in /home2/feet/public_html/Sources/Recent.php on line 1366

Has anybody any idea of what this could be and how to resolve it?
Thank you in advance for your help.
Title: Re: Recent posts user preference
Post by: miseryshining on May 20, 2009, 09:07:37 PM
Quote from: Bjuan on May 20, 2009, 08:23:58 PM
Hello!

I would like to use this add-on on version 1.1.8 .
After installing it, I get the following error message when I click on "Show unread posts since last visit." "Show new replies to your posts." or "View the most recent posts on the forum." -->

Fatal error: Cannot redeclare recenttopics() (previously declared in /home2/feet/public_html/Sources/Recent.php:3) in /home2/feet/public_html/Sources/Recent.php on line 1366

Has anybody any idea of what this could be and how to resolve it?
Thank you in advance for your help.

Most likely, something went wrong during installation, and some parts got installed twice (this is not an error of the mod, but something that can happen). You will have to edit the templates manually or overwrite the mentioned files with the ones that came with the SMF installation (don't do this while having other mods installed though!)

To find out which changes are made, you can check the manual installation instructions. Then you will have to check the files to see if the code parts are installed twice and remove one of them.
Title: Re: Recent posts user preference
Post by: Sudhakar Arjunan on May 22, 2009, 02:01:35 PM
Excellent mod,

I have recent topics also.

No error during installation.

Everything worked good.

Got an error when i click Recent Topics & on error log,

http://sitename.com/index.php?
Apply Filter: Only show the errors with the same message
Database error, given array of integer values is empty. (include_boards)
Function: ssi_recentPosts
Apply Filter: Only show the errors from this file
File: /home/sitename/public_html/discuss/SSI.php
Line: 361

--------

Direct url issue :

Fatal error: Cannot redeclare recenttopics() (previously declared in /home/sitename/public_html/discuss/Sources/Recent.php:1330) in /home/sitename/public_html/discuss/Sources/Recent.php on line 1627
Title: Re: Recent posts user preference
Post by: miseryshining on May 22, 2009, 02:34:00 PM
Quote from: A.SK on May 22, 2009, 02:01:35 PM
Excellent mod,

I have recent topics also.

What do you mean with that?

QuoteGot an error when i click Recent Topics & on error log,

http://sitename.com/index.php?
Apply Filter: Only show the errors with the same message
Database error, given array of integer values is empty. (include_boards)
Function: ssi_recentPosts
Apply Filter: Only show the errors from this file
File: /home/sitename/public_html/discuss/SSI.php
Line: 361

--------

Direct url issue :

Fatal error: Cannot redeclare recenttopics() (previously declared in /home/sitename/public_html/discuss/Sources/Recent.php:1330) in /home/sitename/public_html/discuss/Sources/Recent.php on line 1627

This seems to be the same problem as the one in the previous post. What version of SMF are you using? Try to follow the steps i described above to fix it.
Title: Re: Recent posts user preference
Post by: WVPreacher on May 25, 2009, 08:21:29 PM
Installed and working great. :D

The only small glitch I see is that when I have a new post, it does not update after clicking on a thread.  For example, the topic still shows "New" even though it does not have any new posts.

But I will still keep it!!!  Thanks for updating. :)
Title: Re: Recent posts user preference
Post by: miseryshining on May 26, 2009, 11:40:06 AM
Quote from: WVPreacher on May 25, 2009, 08:21:29 PM
Installed and working great. :D

The only small glitch I see is that when I have a new post, it does not update after clicking on a thread.  For example, the topic still shows "New" even though it does not have any new posts.

But I will still keep it!!!  Thanks for updating. :)

it should update the status - can you give me a link to your forums?
Title: Re: Recent posts user preference
Post by: Sudhakar Arjunan on June 01, 2009, 12:07:56 PM
Quote from: miseryshining on May 22, 2009, 02:34:00 PM

What do you mean with that?


I have a mod called Recent Topics, which is already been installed in my forum.

Quote from: miseryshining on May 22, 2009, 02:34:00 PM

This seems to be the same problem as the one in the previous post. What version of SMF are you using? Try to follow the steps i described above to fix it.

SMF 2.0. RC1-1.
Title: Re: Recent posts user preference
Post by: baioslaio on June 12, 2009, 07:54:05 AM
Hey! My recenttopics page currently look like this.
(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fdata.fuskbugg.se%2Fskalman01%2Frecent_topics.PNG&hash=c05664340f1438125df2cf5b3e4420869d35809f)

What changes need to be made if i want to use catbg.gif in the gray area as a background there as wel
Title: Re: Recent posts user preference
Post by: miseryshining on June 12, 2009, 04:07:00 PM
Quote from: baioslaio on June 12, 2009, 07:54:05 AM
Hey! My recenttopics page currently look like this.
(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fdata.fuskbugg.se%2Fskalman01%2Frecent_topics.PNG&hash=c05664340f1438125df2cf5b3e4420869d35809f)

What changes need to be made if i want to use catbg.gif in the gray area as a background there as wel

Do you want the whole rows to be dark grey? There are quite a few grey areas you know.

to make all rows dark grey add the following code to the bottom of the theme's style.css:


.windowbg, .windowbg2, .windowbg3 {
  background: url(images/catbg.gif);
}
Title: Re: Recent posts user preference
Post by: selket on July 10, 2009, 07:30:03 PM
I'm trying to install this mode.
Please tell me how this should be done:
"
This file should not be able to execute standalone. You may have to run the following queries manually.

Query: [Select]

ALTER TABLE {$db_prefix}members ADD `recentpostBoards` TEXT NULL

Query: [Select]

ALTER TABLE {$db_prefix}members ADD `recentLastOnly` TINYINT NULL

Query: [Select]

ALTER TABLE {$db_prefix}members ADD `recentNrofPosts` TINYINT NULL

Query: [Select]

INSERT INTO {$db_prefix}settings VALUES ('recentpostsExtraprefs', 0)
"

And if I decide to uninstall the mode how this querys must be undone?

Thank you.
Title: Re: Recent posts user preference
Post by: culturejam on July 11, 2009, 03:52:16 PM
Hello. I just installed this mod for 1.1.9. Everything went fine, but I have no way to access the options through the admin interface. Here's what I see when I got to Features&Settings (see attached image). It looks like the dividers are there between Layout&Options and Karma, but no heading for this mod.

Seems like it should be an easy fix, but I can't figure it out. Any ideas?
Title: Re: Recent posts user preference
Post by: culturejam on July 14, 2009, 07:28:53 PM
Little bump.  8)
Title: Re: Recent posts user preference
Post by: miseryshining on July 23, 2009, 04:10:29 PM
Quote from: selket on July 10, 2009, 07:30:03 PM
I'm trying to install this mode.
Please tell me how this should be done:
"
This file should not be able to execute standalone. You may have to run the following queries manually.

Query: [Select]

ALTER TABLE {$db_prefix}members ADD `recentpostBoards` TEXT NULL

Query: [Select]

ALTER TABLE {$db_prefix}members ADD `recentLastOnly` TINYINT NULL

Query: [Select]

ALTER TABLE {$db_prefix}members ADD `recentNrofPosts` TINYINT NULL

Query: [Select]

INSERT INTO {$db_prefix}settings VALUES ('recentpostsExtraprefs', 0)
"

And if I decide to uninstall the mode how this querys must be undone?

Thank you.

Are you trying to do a manual install? The mod should install automatically. when you uninstall the mod these fields will stay in the database. you can remove them manually if you want to.

Quote from: culturejam on July 11, 2009, 03:52:16 PM
Hello. I just installed this mod for 1.1.9. Everything went fine, but I have no way to access the options through the admin interface. Here's what I see when I got to Features&Settings (see attached image). It looks like the dividers are there between Layout&Options and Karma, but no heading for this mod.

Seems like it should be an easy fix, but I can't figure it out. Any ideas?


If you look in your ModSettings.english.php file (usually located in the languages dir in the default theme dir), do you see the following strings?


$txt['recentposts_title'] = 'Recent posts/topics';
$txt['recentpostsExtraprefs'] = 'Enable extra user preferences for recent post blocks';
$txt['recentpostsLimitdays'] = 'Timeframe in which to search for recent posts/topics (in days)';
$txt['recentpostsNrofposts'] = 'Number of posts to show in blocks by default';
$txt['recentpostsMode'] = 'Use recent topics mode (instead of posts) on board index';
$helptxt['recentpostsMode'] = 'Will show recent topics instead of posts for members that haven\'t set up their preferences and for guests.';


if not, they weren't added during installation.
Title: Re: Recent posts user preference
Post by: selket on July 27, 2009, 04:57:28 PM
I uninstalled the mod and now I get this error on my error logs:

http://www.xxxxxx.ro/forum/index.php?pretty;action=profile&amp;u=24

Undefined index: RP_recentPosts
Fişier: /home/fabulous/public_html/forum/Sources/Profile.php
Linie: 233

This is line 233 on Profile.php:

   $context['profile_areas']['edit_profile']['areas']['pmprefs'] = '<a href="' . $scripturl . '?action=profile;u=' . $memID . ';sa=pmprefs">' . $txt['pmprefs'] . '</a>';

Can you tell what is the problem?
Title: Re: Recent posts user preference
Post by: miseryshining on July 29, 2009, 03:19:21 PM
Quote from: selket on July 27, 2009, 04:57:28 PM
I uninstalled the mod and now I get this error on my error logs:

http://www.xxxxxx.ro/forum/index.php?pretty;action=profile&amp;u=24

Undefined index: RP_recentPosts
Fişier: /home/fabulous/public_html/forum/Sources/Profile.php
Linie: 233

This is line 233 on Profile.php:

   $context['profile_areas']['edit_profile']['areas']['pmprefs'] = '<a href="' . $scripturl . '?action=profile;u=' . $memID . ';sa=pmprefs">' . $txt['pmprefs'] . '</a>';

Can you tell what is the problem?

not really, there should be a reference to "RP_recentPosts" left somewhere in there, try a search in the file (or there's some cache at work, and it should clear out later).
Title: Re: Recent posts user preference
Post by: kyle007 on August 17, 2009, 11:37:31 AM
First of all, thanks for this great mod. The filter options are really useful...

But i have question. By default, if a user didn't change his recent post prefs from his profile, last topics block shows all board's posts...

I want to exclude a few boards by default. For example, i have a "Off Topic" board, so i don't want the posts of it to be shown in recent post block, unless a user select it from his profile prefs...

I try this code :

Quoterequire_once('SSI.php');
if (function_exists('ssi_recentPostsPref')) ssi_recentPostsPref(null,'1,2,3,5');

number 4 (which isn't there) is my "Off topic" board id... But i get an error, says :

QuoteYou have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')
AND m.posterTime > 1249659240
AND (FIND_IN_SET(34, b.memberGroups) OR FI' at line 13
Dosya: /var/www/vhosts/hardwarena.com/subdomains/forum/httpdocs/SSI.php
Satır: 320

The 320. line of my SSI.php is :

QuoteLIMIT $num_recent", __FILE__, __LINE__);

What should i do, show me the solution please :)
Title: Re: Recent posts user preference
Post by: miseryshining on August 20, 2009, 07:14:28 PM
Quote from: kyle007 on August 17, 2009, 11:37:31 AM
First of all, thanks for this great mod. The filter options are really useful...

But i have question. By default, if a user didn't change his recent post prefs from his profile, last topics block shows all board's posts...

I want to exclude a few boards by default. For example, i have a "Off Topic" board, so i don't want the posts of it to be shown in recent post block, unless a user select it from his profile prefs...

I try this code :

Quoterequire_once('SSI.php');
if (function_exists('ssi_recentPostsPref')) ssi_recentPostsPref(null,'1,2,3,5');

number 4 (which isn't there) is my "Off topic" board id... But i get an error, says :

QuoteYou have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')
AND m.posterTime > 1249659240
AND (FIND_IN_SET(34, b.memberGroups) OR FI' at line 13
Dosya: /var/www/vhosts/hardwarena.com/subdomains/forum/httpdocs/SSI.php
Satır: 320

The 320. line of my SSI.php is :

QuoteLIMIT $num_recent", __FILE__, __LINE__);

What should i do, show me the solution please :)

First I'll need to know what version you are using. In SMF 2 the syntax has changed a little, instead of the comma seperated list you have to supply an array, like so:

ssi_recentPostsPref(null,array(1,2,3,5));
Title: Re: Recent posts user preference
Post by: kyle007 on August 21, 2009, 08:36:22 AM
No, my version is 1.1.10

Edit : Actually, forget it. I want this block not be shown to users who has  under 20 post... Sorry for my english, buy you understand me ,ha :D

What code i must use to do that ?  O:)
Title: Re: Recent posts user preference
Post by: miseryshining on August 21, 2009, 11:54:16 AM
Quote from: kyle007 on August 21, 2009, 08:36:22 AM
No, my version is 1.1.10

Edit : Actually, forget it. I want this block not be shown to users who has  under 20 post... Sorry for my english, buy you understand me ,ha :D

What code i must use to do that ?  O:)

I suppose you could add a post count enabled group for that and then check if they are a member of it. it's out of the scope of this mod really :)

About 1.1, i'll have to install a test board and see if i can find the problem. will take a while.
Title: Re: Recent posts user preference
Post by: kyle007 on August 24, 2009, 09:31:00 AM
Ok, at least i'm waiting you to solve my default board id's issue that i've mentioned...
Title: Re: Recent posts user preference
Post by: tarunkumar1976 on August 29, 2009, 10:24:49 AM

HI,

   I have installed this mod . I have a custom theme. I havent done any setting .I dont see any recent posts
in the home page where i see the boards. Can you please tell me what i should do in order to see the recent posts.


Title: Re: Recent posts user preference
Post by: TeaTephi on August 29, 2009, 09:58:05 PM
HEELLLOO!

Ok, Great Mod!  I installed on 1.1.10 (with Tiny Portal) and checked the boards I wanted but nothing happened?

Is it incompatible with Tiny portal or 1.1.10?

Thanks!

www.shepherdsdisciples.com
Title: Re: Recent posts user preference
Post by: muttonhead on August 30, 2009, 08:21:04 AM
Hi,

I just did a quick install of SMF and the only modification that I have made is to install recentposts_306.tgz.  The mod installation went great but I don't see anything anywhere in either the user or admin areas that indicates that it is installed.

The version of SMF that I'm using is 1.1.10.  When I go to Admin / Features and Options my choices are Basic Features / Layout and Options / Karma - I don't see anything else.

When I go to Profile, in the Modify Profile area I see a blank line with no link in between the Preferences and Notifications and Email links.

I'm brand new to SMF, so I probably missed something.  Do I need to have any other mods installed prior to installing this one to gain the functionality?

Thank you!
Title: Re: Recent posts user preference
Post by: Bec on October 14, 2009, 07:52:17 PM
just installed on my 1.1.10 forum and it has come to my attention that it is not showing all recent topics - i have it set to show topics instead of posts and user preferences are disabled as I want it to just show all recent topics.... am i missing something? does it now show all recent topics as default?
Title: Re: Recent posts user preference
Post by: jaz~ on November 04, 2009, 01:51:09 AM
Um, hi.
I'm a complete idiot at these kind of things and none of us (on the forum im a member of) really understand it well haha 8D;
so heres an explanation of what i want:

http://custom.simplemachines.org/mods/index.php?action=download;mod=654;id=59409;image
im not sure, but im assuming this mod is for the index page...? well id like that ^ for the recent posts page....
im not sure if you can do that or if its really simple (and it is actually really FOR the recent posts page) but im really bad at these things haha..
sorry if someone could explain it in a way thats not TOO complicated, or direct me to exactly the steps i need to follow... i can install mods fine but i get confused looking at all these different options and alternate options

oh and this is really stupid but what exactly is a topic block? D: is it just....blocking specific topics...? gah sorry. oh and im using smf 1.1.10
thanks so much if you help!

EDIT:// finally fixed this sorry for bothering!
Title: Re: Recent posts user preference
Post by: mikev on November 14, 2009, 12:24:20 PM
Just upgraded from RC1-1 to RC1-2 and this mod is no longer working.  Is there going to be an update to this?
Title: Re: Recent posts user preference
Post by: linette97 on November 25, 2009, 06:41:03 PM
Quote from: mikev on November 14, 2009, 12:24:20 PM
Just upgraded from RC1-1 to RC1-2 and this mod is no longer working.  Is there going to be an update to this?

Same here.. Have RC1-2 & unable to install, would love this mod! Thanks!
Title: Re: Recent posts user preference
Post by: vhs on December 17, 2009, 10:20:26 AM
Any news about 2.0 RC2 version ?
Title: Re: Recent posts user preference
Post by: Mick. on December 21, 2009, 04:55:22 PM
Quote from: vhs on December 17, 2009, 10:20:26 AM
Any news about 2.0 RC2 version ?

....bump.
Title: Re: Recent posts user preference
Post by: Bec on January 02, 2010, 03:23:55 PM
Quote from: Bec on October 14, 2009, 07:52:17 PM
just installed on my 1.1.10 forum and it has come to my attention that it is not showing all recent topics - i have it set to show topics instead of posts and user preferences are disabled as I want it to just show all recent topics.... am i missing something? does it now show all recent topics as default?

I would greatly appreciate a response!
Title: Re: Recent posts user preference
Post by: LadyHawk on January 04, 2010, 09:19:31 AM
I know this mod is for 1.1.10  :P
I tried anyway installing it for 1.1.11 manualy

All went fine and everything is showing and seems to work.
But when I try to set up things in my profile I get this error:

Unknown column 'recentpostBoards' in 'field list'
File: /xxxx/xxxx/xx/xxxxxx/html/Sources/Profile.php
Line: 1033

I searched for the file and this is what shows:

Quote// Make any recent board changes that are sent with the profile..
function makeRecentPostsChanges($memID)
{
   global $db_prefix, $modSettings;

   //recent posts settings are changed
   if (isset($_POST['sa']) && $_POST['sa'] == 'recentPosts') {
      $boardRecentStr = isset($_POST['boardRecent']) ? implode(',', $_POST['boardRecent']) : 0;
      if (isset($_POST['lastOnly']))
         $recentLastOnly = 2;
      else $recentLastOnly = 1;
      if (empty($_POST['nrofPosts'])) $_POST['nrofPosts'] = 10;
   
      db_query("
         UPDATE {$db_prefix}members
         SET recentpostBoards = '{$boardRecentStr}',
         recentLastOnly = $recentLastOnly,
         recentNrofPosts = {$_POST['nrofPosts']}
         WHERE ID_MEMBER = {$memID} LIMIT 1", __FILE__, __LINE__);
   }
}

The red is line 1033
This is exactly the same as the mod says, so what am I doing wrong here?
Is there a solution, please let me know.

I use default core theme  and freshly installed 1.1.11
I use a bunch of mods (-/+) 20

Thanx for reading and hopefully a answer
Title: Re: Recent posts user preference
Post by: Bec on January 23, 2010, 06:26:53 PM
is anyone supporting this mod?

I originally posted my problem back October 15, 2009 and no one has been offering support since August 22, 2009. I understand people get busy but still you created the mod you need to a least be here occasionally to support it especially when there are issues with it!
Title: Re: Recent posts user preference
Post by: Mimmi on January 31, 2010, 11:14:23 AM
Quote from: Bec on January 23, 2010, 06:26:53 PM
is anyone supporting this mod?

I originally posted my problem back October 15, 2009 and no one has been offering support since August 22, 2009. I understand people get busy but still you created the mod you need to a least be here occasionally to support it especially when there are issues with it!

I disagree. As long as we get a mod for free we can't demand support. If people had to promise to support their mods there wouldn't be any. Things happens. People get sick, they loose their inspiration to do things for free, or they just get busy. A company you pay you may demand support from. A devoted person who spends hours and days creating things for others to enjoy can not give the same amount of service, over time.

So, to your problem:
Quote from: Bec on October 14, 2009, 07:52:17 PM
just installed on my 1.1.10 forum and it has come to my attention that it is not showing all recent topics - i have it set to show topics instead of posts and user preferences are disabled as I want it to just show all recent topics.... am i missing something? does it now show all recent topics as default?

If you able user preferences your domain/index.php?action=featuresettings;sa=recentposts; and then go to you own profile, Recent posts settings index.php?action=profile;u=N;sa=recentPosts, is it then possible for you to choose which boards you want to monitor? If you select all, and check the Recent topics list, is all the topics there now? index.php?action=recenttopics If nothing's missing, then try to disable the user preferences.  Is the topics list still correct?

If not, I would urge you to able the user preferences again. What's the disadvantage of letting people choose for themselves which boards to monitor?

The way I use it:
Enable extra user preferences for recent post blocks: Check
Use recent topics mode (instead of posts) on board index: Disabled

Some of my users prefers the Recent posts list. So I let them choose. Recent posts is still available from below the user name, while Recent topics is available from the Menu. Maybe you too may do something like that?
Title: Re: Recent posts user preference
Post by: colby2152 on April 07, 2010, 09:07:33 AM
I agree... I have been tracking this mod for quite some time eagerly awaiting an update, but the original author is not obligated to do anything.
Title: Re: Recent posts user preference
Post by: unformatted_ on November 11, 2010, 11:38:52 AM
Hi!
Cant install on smf 2.0 rc3
Someaone can help me please?
Its possible to update this mod to the latest smf version?

thanls
Title: Re: Recent posts user preference
Post by: colby2152 on November 13, 2010, 10:58:17 AM
Quote from: vasco on November 11, 2010, 11:38:52 AM
Hi!
Cant install on smf 2.0 rc3
Someaone can help me please?
Its possible to update this mod to the latest smf version?

thanls

The mod creator would have to do this...
Title: Re: Recent posts user preference
Post by: ayteck on December 30, 2010, 05:21:10 PM
im waiting too for 2.0 rc3
Title: Re: Recent posts user preference
Post by: Lewzor on January 25, 2011, 09:49:08 AM
I'm assuming this is prolly a discontinued mod , even though i was hoping to see some rc4 updates....... would really prove useful *l00x it over*
Title: Re: Recent posts user preference
Post by: _sebas_ on February 17, 2011, 01:36:44 AM
I have  SMF  1.1.12

---------
the point is that the participated icons do not appear to  in the page "recenttemplates"

Does anyone know why this happens?
Can you afford?

(https://www.simplemachines.org/community/Themes/default/images/topic/my_normal_post.gif)
versus
(https://www.simplemachines.org/community/Themes/default/images/topic/normal_post.gif)
Title: Re: Recent posts user preference
Post by: _sebas_ on March 26, 2011, 10:41:52 PM
two questions


1 - Forums are always growing, the problem is that adding a new subforum, default user preferences appears that new subforum as unchecked.
Is it possible that by default the subforum appear selected to display the topics on the list?
How I can do?
"I can change any default option of the database?


2 - is possible add the flag "new" in the list of recent topics in Boardindex ?
Title: Re: Recent posts user preference
Post by: _sebas_ on April 01, 2011, 01:22:29 PM
nobody?

please, question -1 is very important !
Title: Re: Recent posts user preference
Post by: Angie on Dialysis on May 04, 2011, 10:56:23 PM
I have a special request to the mod maker .. is there any way to get this so that it can be set from the admin side which topics to show on the recent post box? I am admin of my board and do not wish to show
thread games" in that box but just show medical news and support and important posts like that..
Title: Re: Recent posts user preference
Post by: _sebas_ on May 17, 2011, 05:39:22 PM
HELP !! please !

this Mod has a serious lack, which then emerges as time passes and the forum grows.

****
by default, when NEW Subforums created :  its recent topics not are selected to visible to users,
****

Anyone who knows how to hack the code for adding a new sub-forum, by default, their topics are visible in the recent list?

This makes it totally useless mod work

Any other idea of brute force? Reset?
overrided from administration ?
Title: Re: Recent posts user preference
Post by: ellion on June 26, 2011, 07:58:10 AM
Any body managed to get this working on 2.0gold?

it would a shame if this was abandoned as it added much better featurees than the other recent post prefernece mods.
Title: Re: Recent posts user preference
Post by: colby2152 on August 18, 2011, 11:27:22 AM
Quote from: ellion on June 26, 2011, 07:58:10 AM
Any body managed to get this working on 2.0gold?

it would a shame if this was abandoned as it added much better featurees than the other recent post prefernece mods.

Still waiting on it for 2.0 RC5,,,
Title: Re: Recent posts user preference
Post by: oridyne on March 03, 2013, 03:04:58 PM
Hi
Just tried this mod but getting the following errors:

8: Undefined index: views
File: xx/Forum/Themes/default/BoardIndex.template.php (main sub template - eval?)
Line: 340
8: Undefined index: replies
File: xx/Forum/Themes/default/BoardIndex.template.php (main sub template - eval?)
Line: 339

I have the "advanced recent posts" mod installed, which I am sure is the cause of the issue, but not sure if I can alter the code to fix this?
Any help?
Title: Re: Recent posts user preference
Post by: Angie on Dialysis on March 04, 2013, 03:27:09 PM
Is anyone willing (who has the know how) to take this mod over since it is obviously abandoned? I think there is a huge demand still for it.

Quote from: sebtor on May 17, 2011, 05:39:22 PM
HELP !! please !

this Mod has a serious lack, which then emerges as time passes and the forum grows.

****
by default, when NEW Subforums created :  its recent topics not are selected to visible to users,
****

Anyone who knows how to hack the code for adding a new sub-forum, by default, their topics are visible in the recent list?

This is interesting to me. Wonder if there is a simple way to hack the code to control which are visible and which are not. I would be interested if there is because in my case I want to make certain sections NOT show up on the recent posts mod.

Also it seems this is more updated (2012) one for 1.+ AND 2.+ SMF: http://custom.simplemachines.org/mods/index.php?mod=2469 (thread: http://www.simplemachines.org/community/index.php?topic=369478.0_http://www.simplemachines.org/community/index.php?topic=369478.0)

Originally when I got this mod I thought it could filter out certain sections:

Quotesupported filters:

boards=all; (all boards, overrides user preference)
boards=2,4; (board filter, overrides user preference)
limit=3; (days)

But it seems it is by user and not admin done for the whole board.... which my members are not the most technically savvy...

Quote from: miseryshining on March 19, 2007, 05:37:32 PM
[admins]
SMF2: "configuration -> modifications -> Recent posts/topics"
SMF1: "features and options -> Recent posts/topics"

  • enable extra user settings for users (only relevant for blocks)
  • Use recent topics mode instead on board index
  • Nr of posts to whow in blocks by default
  • Timeframe in which to search for recent posts/topics (in days)
Title: Re: Recent posts user preference
Post by: croboy on April 20, 2013, 04:50:18 PM
I think it it really important that SMF has mod like this. In my opionion filtering is not crucial. We just need to have option to list recent topics instead posts.
Title: Re: Recent posts user preference
Post by: NHWD on December 03, 2013, 06:00:18 PM
Wow i just found this mod and it looks really useful. It's a shame that it hasn't been updated.