Topic Digest 1.1 (Post Chest)

Started by Sheepy, November 20, 2005, 03:29:28 AM

Previous topic - Next topic

Sheepy

Link to Mod

This mod adds the ability to flag topics to be displayed in digest view and to be saved from forum maintainence.
Topics can be flagged or unflagged if the user has permission to make sticky, default to moderators only.

It is possible to view digest for a single board, a single category, or whole forum. (New in version 1.1)

Topic digest status is global and visible to all.

The mod can be disabled completely from topic settings.
To show links to category digest, enable it in theme settings.

Tested on SMF 1.1 RC 1

Chinese users have to install only Chinese version.  Do not install both.

Kajin_Style

Hey can I get a screen shot of it? It be helpful to get an idea of it works and the usefulness of it.

Sheepy

#2
Here I've just made one.  http://www.anetcity.com/bbs/index.php?topic=5889.msg22630#msg22630

When you get lots of topics, people often have difficulty finding useful posts, like answers on a support board, walkthoughs on a game board, etc.  Often you don't want to make all the topics sticky since that would be too much, assuming you have more then a few pages of topics.  This is the solution.

It also helps a lot when you want to reserve gems that would otherwise lost to forum maintainence since they're not important enough to be sticky.

It's a feature that is extremely popular in Chinese forums, and is among the first features to be requested.  Actually I see it requested on every Chinese SMF boards I visited.

Thanks, because I noticed I missed the legend at bottom of board view while doing the screenshot.  Ah well I know I missed something.

spaceman

I'm using a theme so I have to manually install the mod.

May I know how do I insert the "install.php" file content into the Mysql database?

P/s: Directly run it will result in Fatal error: Call to undefined function: db_query() on line 5

Thanks for your help!

Sheepy

Well, try to open it with an editor.  The first query is a check and the second is real work.

Or just execute:
ALTER IGNORE TABLE smf_topics ADD `chested` TINYINT( 2 ) UNSIGNED DEFAULT '0' NOT NULL AFTER `isSticky`

This is slightly different.  It's the version I'm going to use in the next version.[/color]

Sheepy

Just updated to version 1.1  This is a relatively big update that sees addition of enable/disable option, view all/category/categories digest (chested) topic, legend, and improved code style.

I also renamed the mod and changed the language strings plus images, to reflect that it is often used to build a digest out of the forum.

To upgrade, just download and install.  No uninstallation necesasry (unless you changed something...)

spaceman

May I suggest this new feature:

A Post Chest: 0 (Number) under profile of every member and in every post under their avatar, to show how many of their topics are being promoted.

P/s: I'm currently using v1.0 so it would be most appreciated if you could guide me on how to add this feature only coz I'm feeling lazy to upgrade to v1.1. As I don't use Package Manager, I add every mod manually due to third-party theme installed.

Thanks for the great mod!! ;)

Sheepy

Since there is no counter in user data, it will take an additional query to do that.

After user settings is loaded from database (e.g. right before the comment "Let's not do this if one of many conditions is true" in Load.php, query "SELECT COUNT(*)
FROM {$db_prefix}topics WHERE chested >0 AND ID_MEMBER_STARTED = $ID_MEMBER".  That's the number of chested post.  Add it to $user_settings then $user_info, and you can show it in template.

spaceman

Quote from: Sheepy on December 03, 2005, 03:19:42 PM
Add it to $user_settings then $user_info, and you can show it in template.

I'm not quite sure of this step: where exactly should I add what..?

By the way, will adding this additional feature work for previously chested topics? If so I don't have to unchest and rechest them to make increment in User's Chested Topics count.

Thank you VERY MUCH for your help!!

Sheepy

Yes it works with all chested/unchest posts, unfortunately I just realised incluing those in recycle bin and hidden boards too.

Hmm.  It involves slightly more changes then that.  I'll make an update then, so it would be easier for you.

Enc0der

hey..

how about a compatible version for 1.1 RC2 ?

spaceman

Hello, I've a new idea can you please advise me how to implement it?

-> If a topic is chested (or digested) the topic title link colour be changed to RED or any other colour allowing visitors to easily distinguish them from normal topics.

-> I know something should be added/modified in BoardIndex.template.php (If not mistaken) and using "if ($topic[is_sticky])..." or something similar. Please also take care of new topics which are bolded and if it's chested as well, it should be in RED + Bolded.

Thanks very much for your generous help!! :)

tadei

Need heep, urgent!

I installed the mood - everything was fine. Then I tried to remove a normal topic I got this message:

Parse error: parse error, unexpected T_VARIABLE in /var/www/web.pilcom/bloke.si/html/forum/Sources/RemoveTopic.php on line 163

I unchecked the topic digest in topic settings ... nothing changed. Then I tried to uninstall the mod. All tests were successful but after clicking uninstall I got the message:

You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'IGNORE FROM `blokesidb`.smf_settings WHERE `variable` = 'enable
File: /var/www/web.pilcom/bloke.si/html/forum/Packages/temp/uninstall.php
Line: 15

After that I returned to index and tried to click any board and got everywhere this message:

Unknown column 't.chested' in 'field list'
File: /var/www/web.pilcom/bloke.si/html/forum/Sources/MessageIndex.php
Line: 479


What to do? I feel like I haven't changed a thing but thigs just got worse. Help, please!

Tadej

tadei

Quote from: tadei on February 07, 2006, 03:44:43 PM
Need heep, urgent!

Ok, I somehow manage to get forum to work ... I replaced RemoveTopic.php, Display.php and MessageIndex.php from Sources directory with files from original smf RC1 installation. At first glance everything works fine.

Probably there is still work to do? Concerning previous problems. And idea? I'm worried about that error in SQL syntax and problem with uninstalling the mod.

Thanks, Tadej

Sheepy

Sorry I'm busy moving from United Kingdom back to my home city Hong Kong, so I may not be able to check that for a while. @_@

Oh... I've got 20 boxes delievered to my house, but only half the days to pack them, before deducing farewells. >_<

Orbit45244

#15
Quote from: tadei on February 07, 2006, 03:44:43 PM
Need heep, urgent!

I installed the mood - everything was fine. Then I tried to remove a normal topic I got this message:

Parse error: parse error, unexpected T_VARIABLE in /var/www/web.pilcom/bloke.si/html/forum/Sources/RemoveTopic.php on line 163

I have figured out how to fix this error through trial-and-error.

Replace line 163 with this:
if (!empty($modSettings['enableChest']))
                $condition .= '
                        AND t.chested = 0';

K_4_kelly

i was trying to install the mod, but i've got the error as below,
anyone can help ? thanks

Table 'mywalker_smf1.smf_board_permissions' doesn't exist
File: /home/livchic/public_html/forum/Packages/temp/install.php
Line: 36

K_4_kelly

i got the following error, when i try to uninstall it....
could anyone advise me? thanks


You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'IGNORE FROM smf_settings WHERE `variable` = 'enableChest' LIMIT
File: /home/mywalker/public_html/forum/Packages/temp/uninstall.php
Line: 15

K_4_kelly

also, below is the code i got in my unistall.php

<?php



{



$result db_query("SHOW COLUMNS FROM {$db_prefix}topics LIKE 'chested'"__FILE____LINE__);



$field_exists mysql_num_rows($result) > 0;



mysql_free_result($result);



// add chest field

if ($field_exists)

db_query("ALTER IGNORE TABLE {$db_prefix}topics DROP chested"__FILE____LINE__);



db_query("DELETE IGNORE FROM {$db_prefix}settings WHERE `variable` = 'enableChest' LIMIT 1"__FILE____LINE__);

db_query("DELETE IGNORE FROM {$db_prefix}themes WHERE `variable` = 'show_category_chest'"__FILE____LINE__);



}



?>



Vinspire

Is it something like page filter ?

Advertisement: