News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

First Post on Every Page [Now SMF 2.0.1 compatible]

Started by live627, October 31, 2008, 10:38:36 AM

Previous topic - Next topic

Kermit

Quote from: Apostaganha on December 09, 2011, 02:53:11 PM
Quote from: Kermit on December 09, 2011, 02:49:54 PM
It's even not my mod ,it was the mod which my mod was based on ^^


Link to your mod please?

I added the link on the first page now,just click on the mod name on the first page
My Mods
Please don't PM/mail me for support,unless i invite you
Formerly known as Duncan85
Quote
"Two things are infinite: the universe and human stupidity; and I'm not sure about the the universe."

A. Einstein

hcfwesker

Quote from: Apostaganha on December 09, 2011, 02:12:33 PM
As you can see i DO NOT HAVE THE OPTION INstall :s

Again .....

Quote from: hcfwesker on November 15, 2011, 12:44:40 AM
emulate to SMF 2 RC5 , installs just fine

clicked 'Advance' tab in the bottom right hand side under all your listed packages.  Put  SMF 2 RC5  in the box.  Then INSTALL after the option appears.


Kermit

#142
Quote from: hcfwesker on December 09, 2011, 06:19:44 PM
Quote from: Apostaganha on December 09, 2011, 02:12:33 PM
As you can see i DO NOT HAVE THE OPTION INstall :s

Again .....

Quote from: hcfwesker on November 15, 2011, 12:44:40 AM
emulate to SMF 2 RC5 , installs just fine

clicked 'Advance' tab in the bottom right hand side under all your listed packages.  Put  SMF 2 RC5  in the box.  Then INSTALL after the option appears.



This is no more necessary actually,as the mod is already fully compatible with 2.0.1





ETA:

Quote from: Chas Large on June 06, 2009, 10:19:50 AM
Hi Duncan,
Installed and works great on my 1.1.9. Many thanks.
Any idea how far off the board by board option would be, that's all I need, the option to enable/disable by board rather then a global switch as now.
Thanks
Chas.

Now i have also added the option to enable/disable via Profile Settings
My Mods
Please don't PM/mail me for support,unless i invite you
Formerly known as Duncan85
Quote
"Two things are infinite: the universe and human stupidity; and I'm not sure about the the universe."

A. Einstein

nend

#143
Bug in latest version, hopefully it isn't what the developer intended.

If "Boards to First Post on every Page" is left blank and "Enable the option to show the first post on every page" is enabled the expected behavior would be all boards, but this is not the case. In every board first post on every page is disabled. The problem is there was no check to see if $boards_FirstPostOnEveryPage_active was empty.

Fixed code in Display.php
$sticky_post = "";
// always get post number 0 for sticky topics
if (!empty($modSettings['boards_FirstPostOnEveryPage']))
{
$boards_FirstPostOnEveryPage_active = explode(",", preg_replace("/[^0-9,]/", "", $modSettings['boards_FirstPostOnEveryPage']));
foreach ($boards_FirstPostOnEveryPage_active as $key => $value) if ($value == "") unset($boards_FirstPostOnEveryPage_active[$key]);
}
else $boards_FirstPostOnEveryPage_active = array();
if (($start > 0 || !$ascending) && !empty($modSettings['enableFirstPostOnEveryPage']) && !empty($modSettings['enableFirstPostOnlySticky']) && $context['is_sticky'] && (!empty($boards_FirstPostOnEveryPage_active) && in_array($context['current_board'], $boards_FirstPostOnEveryPage_active) || empty($boards_FirstPostOnEveryPage_active)))
{
$request = $smcFunc['db_query']('', '
SELECT id_msg, id_member, approved
FROM {db_prefix}messages
WHERE id_topic = {int:current_topic}' . (!$modSettings['postmod_active'] || allowedTo('approve_posts') ? '' : (!empty($modSettings['db_mysql_group_by_fix']) ? '' : '
GROUP BY id_msg') . '
HAVING (approved = {int:is_approved}' . ($user_info['is_guest'] ? '' : ' OR id_member = {int:current_member}') . ')') . '
ORDER BY id_msg
LIMIT 1',
array(
'current_member' => $user_info['id'],
'current_topic' => $topic,
'is_approved' => 1,
'blank_id_member' => 0,
)
);


$row = $smcFunc['db_fetch_assoc']($request);
if (!empty($row['id_member']))
$posters[] = $row['id_member'];
$messages[] = $row['id_msg'];
$sticky_post = $row['id_msg'] . ",";
      $smcFunc['db_free_result']($request);
}
elseif (($start > 0 || !$ascending) && !empty($modSettings['enableFirstPostOnEveryPage']) && empty($modSettings['enableFirstPostOnlySticky']) && (!empty($boards_FirstPostOnEveryPage_active) && in_array($context['current_board'], $boards_FirstPostOnEveryPage_active) || empty($boards_FirstPostOnEveryPage_active)))
{
$request = $smcFunc['db_query']('', '
SELECT id_msg, id_member, approved
FROM {db_prefix}messages
WHERE id_topic = {int:current_topic}' . (!$modSettings['postmod_active'] || allowedTo('approve_posts') ? '' : (!empty($modSettings['db_mysql_group_by_fix']) ? '' : '
GROUP BY id_msg') . '
HAVING (approved = {int:is_approved}' . ($user_info['is_guest'] ? '' : ' OR id_member = {int:current_member}') . ')') . '
ORDER BY id_msg
LIMIT 1',
array(
'current_member' => $user_info['id'],
'current_topic' => $topic,
'is_approved' => 1,
'blank_id_member' => 0,
)
);


$row = $smcFunc['db_fetch_assoc']($request);
if (!empty($row['id_member']))
$posters[] = $row['id_member'];
$messages[] = $row['id_msg'];
$sticky_post = $row['id_msg'] . ",";
      $smcFunc['db_free_result']($request);
}

// now fetch the rest of the posts



Kermit

My Mods
Please don't PM/mail me for support,unless i invite you
Formerly known as Duncan85
Quote
"Two things are infinite: the universe and human stupidity; and I'm not sure about the the universe."

A. Einstein

hcfwesker

#145
Thanx for adding the select boards option.  Very much appreciated.

However, one thing is I want to force members to use this option from default and when new member register, and let them turn it off if they want to.  But when I went to change all member's options in the theme settings, it wasn't there.  Could this be something added in a future release?

What changes would have to be made, so if the box is 'unchecked' on members modify profile page, it shows first post on every page for members.  then if they check it, it turns it off for them.   I can make the changes to the language string to "Turn off first post on ever page"

I would just rather have it on by default, for all members, and new members.  Honestly, the option for members to turn iton or off, isn't really needed, cause they really don't know what it's for.  They might think it's for ALL forum topics, not knowing admins are only selecting important boards that the first post of topics would appear on.

Basically, I would prefer the member option not be there, or at least the option to "show first posts" for members by default, and they check the box to turn it off.


hcfwesker

^ any word on how i can accomplish this manually?

sternchenx3

Hey,
first of all: thank you for this mod! i was searching for something like this for a while now.
But...i have a problem with it and i don't know what's causing the trouble: i installed it, and activated it in the admin-panel, but i can't see anything changing, the first post is still only on the first page...
does anyone know what could be wrong here?

greetings,
nightfox

hcfwesker

It's a new setting that I honestly dont like and would like changed.  After the MOD is installed and admin settings are set ... You, and every member on the site ( including new members who probably wont even know the option exists) has to set it up individually in your profiles.  So they're not on by default, sadly.

Profile > Look & Layout ( Show first post on every page)

This really should be on by default for all members once turned on in the admin settings ... but some reason this was added in the latest release.

sternchenx3

Quote from: hcfwesker on January 28, 2012, 07:59:57 PM
It's a new setting that I honestly dont like and would like changed.  After the MOD is installed and admin settings are set ... You, and every member on the site ( including new members who probably wont even know the option exists) has to set it up individually in your profiles.  So they're not on by default, sadly.

Profile > Look & Layout ( Show first post on every page)

This really should be on by default for all members once turned on in the admin settings ... but some reason this was added in the latest release.

I totally agree with you, in my opinion it should be activated for every user once the admin decides to activate it...like this, most user won't even know they can activate this great function...
I really really hope that there will be a way to have it turned on generally (like for themes where you can decide if you want to set all members to a specific theme).

thanks for your answer!

greetings,
Nightfox

hcfwesker

Agree 100%, and even mentioned it need the option here http://www.simplemachines.org/community/index.php?topic=271518.msg3236699#msg3236699

but, no response or suggestions on how to customize it so it is on by default.  but I been looking into it myself.

Kermit

Quote from: hcfwesker on January 28, 2012, 08:31:18 PM
Agree 100%, and even mentioned it need the option here http://www.simplemachines.org/community/index.php?topic=271518.msg3236699#msg3236699

but, no response or suggestions on how to customize it so it is on by default.  but I been looking into it myself.

You can just use old version (1.4),which can be found on the mod page
My Mods
Please don't PM/mail me for support,unless i invite you
Formerly known as Duncan85
Quote
"Two things are infinite: the universe and human stupidity; and I'm not sure about the the universe."

A. Einstein

sternchenx3

Quote from: Kermit on January 29, 2012, 05:23:56 AM
You can just use old version (1.4),which can be found on the mod page

But the feature to choose the boards in which the mod should be active came with 1.5, so...one thing I need would go missing for another, that's not optimal...

hcfwesker

#153
But 1.4 doesn't allow you to select which Boards, and then I'fd have to go back through all those boards and re sticky topics cause I don't want EVERY topic to show first post..

I've found in smf_themes the variable first_post_on_every_page  but nothing in the MOD zip so I can set the default to '1' for all members when it's installed.

sternchenx3

Quote from: hcfwesker on January 29, 2012, 08:17:11 AM


I've found in smf_themes the variable first_post_on_every_page  but nothing in the MOD zip so I can set the default to '1' for all members when it's installed.

Could you explain I little to me how you've done that? (maybe per pm?)
Would be great :D

hcfwesker

#155
It won't do any good.  Cause if you run a database update to change all members option, it only changes for those who have changed the option.  so it doesnt do any good for those who havent checked the option, or new members.

I'm trying to find a way to make it so the default value is "1" for all members by default upon installation.  Maybe moving the variable under smf_members , but I cant find the install action in the Mod package, so I dont even know if it's related.


Kermit

Quote from: hcfwesker on January 28, 2012, 07:59:57 PM
It's a new setting that I honestly dont like and would like changed.  After the MOD is installed and admin settings are set ... You, and every member on the site ( including new members who probably wont even know the option exists) has to set it up individually in your profiles.  So they're not on by default, sadly.

Profile > Look & Layout ( Show first post on every page)

This really should be on by default for all members once turned on in the admin settings ... but some reason this was added in the latest release.

I added that option now,just try from this link

http://custom.simplemachines.org/mods/index.php?action=download;mod=1472;id=196307
My Mods
Please don't PM/mail me for support,unless i invite you
Formerly known as Duncan85
Quote
"Two things are infinite: the universe and human stupidity; and I'm not sure about the the universe."

A. Einstein

hcfwesker

#157
Thank you, kindly, Kermit.   I have a few uninstall errors I have to handle manually.  Once added, I'll test it out and let you know.

just to add, the member who requested the "member option" , was meaning that the First post would appear in it's own header box above posts, and members could minimize them ( like quick reply box)

EDIT:::

OMG YES!!!  The option to set by default and new member options has been added under the Themes option.  thanx so much, Kermit!  :)


Karmalakas

Don't know if this was mentioned, but there's an error in Modifications language file that causes Template Parse Error!
There should be a line break before language strings.

P.S. In SMF2 <b> and <i> tags aren't used anymore.

Advertisement: