News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Recent posts user preference

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

Previous topic - Next topic

ES23

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?

ES23

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

miseryshining

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

ES23

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! :)

miseryshining

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.

FragaCampos

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

miseryshining

#86
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';


FragaCampos

Wasn't supposed to show a box with recent posts on top of the fórum like in this 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.


miseryshining

#88
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 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';


hvyhitter

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.


hvyhitter

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!


miseryshining

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!

zeitwort

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

miseryshining

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?

JaGuR123

#94
never mind got it working  ;)

zeitwort

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

miseryshining

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?

zeitwort

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

miseryshining

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?

zeitwort

I made this testforum for this Mod. Everything ist original.
Wenn du merkst, dass du ein totes Pferd reitest - steig ab!

Advertisement: