News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Recent posts user preference

Started by miseryshining, March 19, 2007, 05:37:32 PM

Previous topic - Next topic

JaGuR123

#120
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 ;)

JaGuR123

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']);
}



JaGuR123

#122
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

:'(

miseryshining

#123
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.

zeitwort

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".
Wenn du merkst, dass du ein totes Pferd reitest - steig ab!

NEMINI

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.

signatures are boring.

miseryshining

#126
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.



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.

NEMINI

#127
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.
signatures are boring.

miseryshining

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.

NEMINI

thank you for your help so far and sorry to be such a pain
signatures are boring.

miseryshining

#130
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 :-)

waz

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:

miseryshining

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.

waz

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.

NEMINI

it works now.  YEAH!  thank you so much for a wonderful mod.
signatures are boring.

Jade Elizabeth

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?
Once proud Documentation Writer and Help Squad Leader | Check out my new adult coloring career: Color With Jade/Patreon.

miseryshining

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. 

Jade Elizabeth

Once proud Documentation Writer and Help Squad Leader | Check out my new adult coloring career: Color With Jade/Patreon.

ES23

#138
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.

miseryshining

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?

Advertisement: