Recent posts user preference

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

Previous topic - Next topic

miseryshining

#40
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?

askepott

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

miseryshining

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?

askepott

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

miseryshining

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.

JaGuR123

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>

miseryshining

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

JaGuR123

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 (\).

:'(

miseryshining

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

JaGuR123

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

miseryshining

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>

JaGuR123

Thank you worked Great.

This has mdae my site so much better  8)

Cheers

miseryshining

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.

JaGuR123

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

miseryshining

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.

JaGuR123

Not exactly sure what you mean with the css code, waht and where should put clear:both ?

And again , big thanks

miseryshining

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;
}

rokit

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? =)

miseryshining

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?

flame baiter

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 :(

Advertisement: