Post Expire

All new MODs released in our MOD Database will be announced in here. All support for released MODs needs to take place in the Customisations Database.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

NOTICE: This forum is only for the announcement of new releases and/or updates of MODs. Any MOD support should be obtained through the Customisations Database in the support area designated for each MOD.

A direct link to support for each MOD is in the first post of the respective topic.
Extensions Robot
Extensions Robot
Extensions Robot
Posts: 27559
Joined: Sat Aug 16, 2003 7:36 am

Post Expire

Post by Extensions Robot » Mon Feb 08, 2010 5:06 am

Modification name: Post Expire
Author: crazygandalf
Modification description: When posting you can set expire time of the post. If this is the first post in topic, expire refers to this entire topic. You can set to delete post/topic after expire time or to lock/move/lock&move the topic. Expire time is displayed on viewtopic page in case of posts, and on viewforum page in case of topics. Mod is fully configurable and allows to set users permissions.
Modification version: 1.0.3
Tested on phpBB version: 3.0.6

Download file: pe_1.0.3.zip
File size: 105.92 KiB

Modification overview page: View

The phpBB Team is not responsible nor required to provide support for this modification. By installing this MOD, you acknowledge that the phpBB Support Team or phpBB Extensions Team may not be able to provide support.

-->Modification support<--
Last edited by Extensions Robot on Mon Mar 27, 2017 3:09 pm, edited 8 times in total.
(this is a non-active account manager for the phpBB Extension Customisations Team)

User avatar
DavidIQ
Customisations Team Leader
Customisations Team Leader
Posts: 16612
Joined: Thu Jan 06, 2005 1:30 pm
Location: Fishkill, NY
Name: David Colón
Contact:

Post Expire

Post by DavidIQ » Mon Feb 08, 2010 5:06 am

Modification validated/released

Notes:
Apply to become a Jr. Extension Validator
My extensions | In need of phpBB services? | Was I helpful today?
No unsolicited PMs unless you're planning on asking for paid help.

crazygandalf
Registered User
Posts: 148
Joined: Thu Oct 14, 2004 10:53 pm

Post Expire

Post by crazygandalf » Mon Feb 08, 2010 5:06 am

Features:
When posting you can set expire time of the post. If this is the first post in topic, expire refers to this entire topic. You can set to delete post/topic after expire time or to lock/move/lock&move the topic. Of course it happens automatically. Expire time is displayed on viewtopic page in case of posts, and on viewforum page in case of topics. Mod is fully configurable and allows to set users permissions. For more info about configuration, permission or changes please take a look at contrib/readme.txt.

Screenshots:
ImageImageImageImageImageImage

Notes:
Please remember to set permissions in ACP. One important thing. Don't set all permissions to "yes". Just read carefully what every permissions allows you to do. Notice "only" status.
For more info about permissions, configuration and other changes (like converting 24h time do 12 AM/PM) look at readme.txt in contrib dir.

Translations:
Polish - included
German - will be included in next release.
Last edited by crazygandalf on Wed Feb 10, 2010 6:07 pm, edited 3 times in total.
Post Expire - set when your post/topic will disappear/be locked/moved.
GG & Tlen & Skype - for polish instant messangers.

User avatar
PinoyEngine™
Registered User
Posts: 244
Joined: Fri Apr 24, 2009 7:12 am

Re: Post Expire

Post by PinoyEngine™ » Mon Feb 08, 2010 12:39 pm

Nice!Congrats for validation.

lugsciath
Registered User
Posts: 316
Joined: Tue Oct 02, 2007 11:12 am

Re: Post Expire

Post by lugsciath » Tue Feb 09, 2010 8:08 am

Okay,

i´d to say anything bad about this modification:

I build it in three times (versions 041 up to actual 1.03) and everytime i build it in i lost posts and topics (most between a few hundered up to thousends), because the mod imho is not testing if some older sql entries havent any content into "expire_date" or time. The posts even was lost, if some refresh was happend or one post had to be regulare delete/moved/closed by the mod.

The problem is: The picking and deleting of posts / topics arent secure enough to use this mod with other mods together (I ve testing it really, really many times - and i made allways a complete backup before, wich is very very recommened for this mod!).

As somebody know, i´m modified, tested and added/edited/translated/build in many mods - but this time i had to say, that i dont know what happend so negative with the sql squeries.

BTW:

I made a announcement, there are dependencies between the expire_mod and Post_bot mod. I never get an answer ...

So i will test it the fourth time, if i really could be sure that this mod doesnt eliminate other posts / topics anymore than that ones which are choosed! Would you agree with me in that? ;)

crazygandalf
Registered User
Posts: 148
Joined: Thu Oct 14, 2004 10:53 pm

Re: Post Expire

Post by crazygandalf » Tue Feb 09, 2010 10:55 pm

lugsciath, you're right.
It's strange, but working on MySQL when topic_expire_time is set to null It is not selected by any of my queries, so it cannot be deleted or moved. What kind of database you're using?
I think I know what code casuses it, but I cannot check this out right now, cause probably I will need to install other databases and connect them to server. Please check if this fix will help you:

Code: Select all

#
#-----[ OPEN ]------------------------------------------
#
includes/functions_display.php

#
#-----[ FIND ]------------------------------------------
#
WHERE topic_expire_time < '. $current_time . ' AND topic_expire_time <> 0';

#
#-----[ REPLACE WITH ]------------------------------------------
#
WHERE topic_expire_time < '. $current_time . ' AND topic_expire_time <> 0 AND topic_expire_time IS NOT NULL';

#
#-----[ FIND ]------------------------------------------
#
WHERE post_expire_time < '. $current_time . ' AND post_expire_time <> 0';

#
#-----[ REPLACE WITH ]------------------------------------------
#
WHERE post_expire_time < '. $current_time . ' AND post_expire_time <> 0 AND post_expire_time IS NOT NULL';
Post Expire - set when your post/topic will disappear/be locked/moved.
GG & Tlen & Skype - for polish instant messangers.

lugsciath
Registered User
Posts: 316
Joined: Tue Oct 02, 2007 11:12 am

Re: Post Expire

Post by lugsciath » Wed Feb 10, 2010 1:45 am

Okay, i will test it once more.

Well, i´d test it with a fully modded working board, so i´ve had many entries without this content ;)

Im using mySql MySQL-Client-Version: 5.0.84

lugsciath
Registered User
Posts: 316
Joined: Tue Oct 02, 2007 11:12 am

Re: Post Expire

Post by lugsciath » Wed Feb 10, 2010 4:11 am

hm,

The posts are now safer than before -

i got at the moment a SECOND little tricky problem: If i made a post (and not the first topic) i cant see any choices, but i'm able to set the expire date. If the post is exired, it is gone elsewhere??? Is this okay and could i disable it? I don´t need it if somebody wants to post something as a timebomb and after all it deleting it after some time automaticly ;).

One thing: It is recommened to delete all "old" expire entries (from version 0.43) eg. delete the database rows and entries for a new installation. May be this could be force the last bug also. But for now: Its gone (until this one for posts!, which also could be a feature )


Thank you

Lugsciath

lugsciath
Registered User
Posts: 316
Joined: Tue Oct 02, 2007 11:12 am

Re: Post Expire

Post by lugsciath » Wed Feb 10, 2010 4:39 am

Okay,

i have a solution for that problem.

First: I dont like it if the mod will deleting 2nd posts(answers) after expiring, im not testing if this happend of all other follwing in this thread. So i've decided to hide this posibility in the posting editor. This is the code:

Code: Select all

	<!-- IF not S_PRIVMSGS and not S_SHOW_DRAFTS and S_POST_EXPIRE -->
		<!-- IF S_TOPIC_EXPIRE_TYPE -->
			<dl>
				<dt style="width:300px;"><label>{L_TOPIC_EXPIRE_TYPE}:</label><br /><span>{L_TOPIC_EXPIRE_TYPE_EXPLAIN}</span></dt>
				<dd>{S_TOPIC_EXPIRE_TYPE}</dd>
			</dl>
		<!-- ENDIF -->
		<!-- IF S_EXPIRE_AFTER_SHOW and S_TOPIC_EXPIRE_TYPE -->
		<dl>
			<dt style="width:300px;"><label for="post_expire_time">{L_POST_EXPIRE_TIME}:</label><br /><span>{L_POST_EXPIRE_TIME_EXPLAIN}</span></dt>
			<dd><select name="post_expire_time" id="post_expire_time">{S_POST_EXPIRE_SELECT}</select></dd>
		</dl>
		<!-- ENDIF -->
		<!-- IF S_EXPIRE_EXACT_SHOW and S_TOPIC_EXPIRE_TYPE -->
		<dl>
			<dt><label for="date_picker">{L_POST_EXPIRE_DATE}:</label><br /><span>{L_POST_EXPIRE_DATE_EXPLAIN}</span></dt>
			<dd>
				<input class="inputbox" name="date_picker" id="date_picker" value="{S_DATE_PICKER}" style="width:130px" /><a href="javascript:NewCssCal('date_picker','ddmmyyyy', true, 24)"><img src="{T_TEMPLATE_PATH}/datepicker/images/cal.gif" width="16" height="16" alt="" title="" /></a>
			</dd>
		</dl>
		<!-- ENDIF -->
		<!-- IF S_EXPIRE_FORUM_OPTIONS and S_TOPIC_EXPIRE_TYPE -->
			<dl>
				<dt style="width:300px;"><label for="expire_forum_id">{L_TOPIC_EXPIRE_SELECT_FORUM}:</label><br /><span>{L_TOPIC_EXPIRE_SELECT_FORUM_EXPLAIN}</span></dt>
				<dd><select name="expire_forum_id" id="expire_forum_id">{S_EXPIRE_FORUM_OPTIONS}</select></dd>
			</dl>
		<!-- ENDIF -->
	<!-- ENDIF -->
i simply insert " and S_TOPIC_EXPIRE_TYPE" in the switches, so the datepicker could used by followers of the first topic posting - and so the posts couldn`t delete.

BTW:

Here are the german language files so far ...

/language/de/mods/pe.php

Code: Select all

<?php
/**
*
* pe [German]
*
* @package language
* @version $Id: pe.php 9001 2009-01-21 17:53:00Z crazygandalf $
* @copyright (c) 2008 crazygandalf
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/

/**
* DO NOT CHANGE
*/
if (!defined('IN_PHPBB'))
{
   exit;
}

if (empty($lang) || !is_array($lang))
{
   $lang = array();
}

$lang = array_merge($lang, array(
//Zahl bedeutet Sekunden
   'post_expire'   => array(
      '-1'   => 'Kein(e) Ablaufzeit/-datum', //do not change the '-1'
      '86400'            => '1 Tag', //60s x 60min x 24h = 86400s
      '172800'         => '2 Tage',
      '259200'         => '3 Tage',
      '345600'         => '4 Tage',
      '432000'         => '5 Tage',
      '518400'         => '6 Tage',
      '604800'         => '1 Woche',
      '2592000'         => '1 Monat',
   ),
   'POST_EXPIRE_TIME'    => 'Zeit bis zum Ablauf des Beitrags',
   'POST_EXPIRE_TIME_EXPLAIN'    => 'Wähle, nach welcher Zeit der Beitrag ablaufen soll.',
   'POST_EXPIRE_DATE'    => 'Datum bis zu Ablauf des Beitrags',
   'POST_EXPIRE_DATE_EXPLAIN'    => 'Wähle, nach welchem Datum der Beitrag ablaufen soll.',
   'POST_WILL_EXPIRE' => 'Beitrag läuft ab in o. am',
   'TOPIC_WILL_EXPIRE' => 'Thema läuft ab in o. am',
   'POST_EXPIRE_NUMBER_ERROR' => 'Es ist ein Fehler bei der Zeitdefinition aufgetreten. Bitte kontaktieren Sie den Administrator.',
   'TOPIC_EXPIRE_TYPE' => 'Art des Zeitablaufs',
   'TOPIC_EXPIRE_TYPE_EXPLAIN' => 'Wähle was nach Ablauf des Themas damit geschehen soll. Wenn keine Ablaufzeit eingestellt ist, hat diese Option keine Funktion.',
   'TOPIC_EXPIRE_DELETE' => 'Löschen',
   'TOPIC_EXPIRE_LOCK' => 'Sperren',
   'INVALID_DATE' => 'Das eingegebene Ablaufdatum ist ungültig.',
   'PAST_DATE' => 'Du kannst kein Ablaufdatum setzen, das in der Vergangenheit liegt.',

//Added in 0.4.0
   'TOPIC_EXPIRE_MOVE' => 'Verschieben',
   'TOPIC_EXPIRE_LOCK_AND_MOVE' => 'Sperren & Verschieben',
   'TOPIC_EXPIRE_SELECT_FORUM' => 'Wähl ein Forum',
   'TOPIC_EXPIRE_SELECT_FORUM_EXPLAIN' => 'Du kannst ein Forum ausählen, wo das Thema hinverschoben wird. Vorgabeforum ist im ACP konfigurierbar.',
   'POST_EXPIRE_SETTINGS' => 'Beitragabgelaufen Einstellungen',
   'POST_EXPIRE_SETTINGS_CHANGED' => 'Beitragabgelaufen Einstellungen geändert',
   'EXPIRE_ENABLE' => 'Beitragabgelaufen Einstellungen ein',
   'EXPIRE_KIND_SET' => 'Art Beitragabgelaufen Einstellungen',
   'EXPIRE_KIND_SET_EXPLAIN' => 'Hier kannst du die Art der Einstellungen für Benutzer für abgel. Beiträge einstellen.',
   'EXPIRE_AFTER' => 'Nach spezifizierter Zeit',
   'EXPIRE_EXACT' => 'Exakt',
   'EXPIRE_BOTH' => 'Beide',
   'EXPIRE_NONE' => 'Keine',
   'EXPIRE_DEFAULT_ACTION' => 'Vorbestimmte Aktion',
   'EXPIRE_DEFAULT_ACTION_EXPLAIN' => 'Du kannst die vorbestimmte Aktion wählen, automatisch fuer einen neuen Beitrag.',
   'EXPIRE_DEFAULT_FORUM' => 'Vorgabeforum',
   'EXPIRE_DEFAULT_FORUM_EXPLAIN' => 'Du kannst ein Vorgabeforum wählen, wo das bestimmte Theme verschoben oder verschoben und gesperrt wird.',
   'EXPIRE_KIND_SET_ERROR' => 'Fehler in der Beitragsauswahl abgelaufen Konfiguration. Bitte Administrator melden',
   'EXPIRE_COLOUR_SET' => 'Unterschiedliche Farbe für Themen und Beiträge',
   'EXPIRE_COLOUR_SET_EXPLAIN' => 'Du kannst die Vorgabefarbe ändern der abgelaufenen Beiträge und Themen. Wähle Ja fuer Farbe.',

//Added in 0.4.1
   'EXPIRE_COLOUR_TIME' => 'Abgelaufen Vorgabefarbe',
   'EXPIRE_COLOUR_TIME_EXPLAIN' => 'Du kannst die Zeit für die Vorgabefarbe angeben, bei der sich abgelaufenen Beiträge ändern. 0 setzt alle Beiträge/Themen. Anzahl bedeutet Stunden.',
   'EXPIRE_MAX_TIME' => 'Abgelaufene max Zeit',
   'EXPIRE_MAX_TIME_EXPLAIN' => 'Du kannst die abgelaufene maximale Zeit für Benutzer setzen. 0 setzt auf unendlich. Anzahl bedeutet Tage.',
   'MAX_DATE' => 'Die abgelaufene maximale Zeit die du setzen kannst ist %s Tage.',
   'MOVE_UNABLE' => 'DU kannst das Thema nicht verschieben, weil du das Forum nicht auswählen kannst.',

//Added in 0.4.2
	'TOPIC_EXPIRE_UNLOCK' => 'Entsperren',
	'TOPIC_EXPIRE_UNLOCK_AND_MOVE' => 'Entsperren & verschieben',

//Added in 1.0.0 RC
	'INSTALL_POST_EXPIRE' => 'Installation von Post Expire',
	'INSTALL_PERM_ADDED' => 'Berechtigungen zugefügt.',
	'INSTALL_TABLE_ALTERED' => 'Tabelle %s geändert.',
	'INSTALL_CONFIGURATION' => 'Konfiguration Einstellungen zugefügt.',
	'INSTALL_PE_MODULE' => 'Post Expire Module zugefügt.',
	'INSTALL_END_NOTES' => 'Post Expire erfolgreich installiert. Install Bitte Verzeichnis verschieben oder loeschen.',
	'INSTALL_RETURN' => 'Zurück zur %sMain page%s.',

//Added in 1.0.2 RC
	'INSTALL_TABLE_ALREADY_ALTERED' => 'Tabelle %s schon geändert.'
));

?>
/language/de/mods/permissions_post_expire.php

Code: Select all

<?php
/**
* permissions_post_expire [English]
*
* @package language
* @version $Id: permissions_post_expire.php 8911 2009-06-05 20:49:33Z crazygandalf $
* @copyright (c) 2009 crazygandalf
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*/

/**
* DO NOT CHANGE
*/
if (!defined('IN_PHPBB'))
{
	exit;
}

if (empty($lang) || !is_array($lang))
{
	$lang = array();
}

$lang['permission_cat']['post_expire'] = 'Post Expire';

$lang = array_merge($lang, array(
	'acl_a_post_expire'		=> array('lang' => 'Kann Beitrags Ablaufzeiteinstellungen ändern', 'cat' => 'posting'),
	'acl_u_post_expire_delete'		=> array('lang' => 'Kann loeschen Ablaufzeit', 'cat' => 'post_expire'),
	'acl_u_post_expire_lock'		=> array('lang' => 'Kann sperren Ablaufzeit', 'cat' => 'post_expire'),
	'acl_u_post_expire_move'		=> array('lang' => 'Kann verschieben Ablaufzeit', 'cat' => 'post_expire'),
	'acl_u_post_expire_lockandmove'		=> array('lang' => 'Kann Sperren und Verschieben Ablaufzeit', 'cat' => 'post_expire'),
	'acl_u_post_expire_only'		=> array('lang' => 'Kann <strong>nur</strong> Beitrag Ablaufzeit setzen ', 'cat' => 'post_expire'),
	'acl_u_topic_expire_only' => array('lang' => 'Kann <strong>nur</strong> Topic Ablaufzeit setzen', 'cat' => 'post_expire'),
	'acl_u_expire_default_forum' => array('lang' => 'Kann <strong>nur</strong> in Vorgabeforum verschieben', 'cat' => 'post_expire'),
));

?>
/language/de/acp/common.php

Code: Select all

	'ACP_POST_EXPIRE_SETTINGS'	=> 'Postablaufeinstellungen',

Code: Select all

	'LOG_POST_EXPIRE_SETTINGS_CHANGED' => '<strong>Postablaufeinstellungen geändert</strong>

If nothing bad should happend next hours, i'll would be happy. Please look for an option, to switch post deleting off (or only lock/move them) ;)

Thank you.

crazygandalf
Registered User
Posts: 148
Joined: Thu Oct 14, 2004 10:53 pm

Re: Post Expire

Post by crazygandalf » Wed Feb 10, 2010 6:04 pm

I'm glad that fix helped you.
And with the second it's not a bug, but a feature. You can diable it by setting a user/group permission: "Can set topic expire time only". Please look at readme.txt where these permissions are described.
Thanks for translation. :)
Post Expire - set when your post/topic will disappear/be locked/moved.
GG & Tlen & Skype - for polish instant messangers.

lugsciath
Registered User
Posts: 316
Joined: Tue Oct 02, 2007 11:12 am

Re: Post Expire

Post by lugsciath » Wed Feb 10, 2010 10:20 pm

"Can set topic expire time only".

okay... forget my changes in the posting editor template, i really missed/hevent seen that passage in the readme, i`m sorry. Worked like a charm :). But neverless: Could you please change that in your new version? On security purposes it would be better to make the deleting functions lesser dangerous or hidden and easy (means: secure enough for noobs like me ;) ... )

Thank you once more ;)
Last edited by lugsciath on Wed Feb 10, 2010 10:40 pm, edited 1 time in total.

crazygandalf
Registered User
Posts: 148
Joined: Thu Oct 14, 2004 10:53 pm

Re: Post Expire

Post by crazygandalf » Wed Feb 10, 2010 10:40 pm

Sure, I will update it as soon as possible. Read, when mod will be approved. :-)
Post Expire - set when your post/topic will disappear/be locked/moved.
GG & Tlen & Skype - for polish instant messangers.

thoomas
Registered User
Posts: 56
Joined: Fri Jul 13, 2007 11:50 am

Re: Post Expire

Post by thoomas » Sun Feb 21, 2010 1:54 pm

great mod! Only thing I wish is if it would be possible to change the color of the message like "the post will expire in...." into red.

User avatar
VSE
Extensions Development Coordinator
Extensions Development Coordinator
Posts: 4570
Joined: Sat Jan 17, 2009 9:37 am
Location: Los Angeles, CA
Name: Matt Friedman
Contact:

Re: Post Expire

Post by VSE » Sun Feb 21, 2010 7:48 pm

Great looking Mod... Some ideas I would love to see added however:
1. Ability to select specific forums you want to enable this feature for
2. Ability to force users to select a time (no option for 'no expire')

My requests would be for using this mod in a classifieds/for sale section of my forum... It'd be great if users could choose an expire time for their topic/ads using this method, rather than relying on phpBBs built-in prune system. Thanks for your work on this! :mrgreen:
Official phpBB Extensions My Extensions & MODs
Please do not PM me for support.
Dictated but not read.

crazygandalf
Registered User
Posts: 148
Joined: Thu Oct 14, 2004 10:53 pm

Re: Post Expire

Post by crazygandalf » Mon Feb 22, 2010 8:29 pm

thoomas wrote:great mod! Only thing I wish is if it would be possible to change the color of the message like "the post will expire in...." into red.

Code: Select all

#
#-----[ OPEN ]------------------------------------------
#
styles/prosilver/template/viewtopic_body.html

#
#-----[ FIND ]------------------------------------------
#
<!-- IF postrow.POST_EXPIRE -->&nbsp;&nbsp;&nbsp;<strong>{L_POST_WILL_EXPIRE}:</strong> {postrow.POST_EXPIRE}<!-- ENDIF --> </p>
#
#-----[ REPLACE WITH ]------------------------------------------
#
<!-- IF postrow.POST_EXPIRE -->&nbsp;&nbsp;&nbsp;<span style="color:red;"><strong>{L_POST_WILL_EXPIRE}:</strong> {postrow.POST_EXPIRE}</span><!-- ENDIF --> </p>
VSE wrote:1. Ability to select specific forums you want to enable this feature for
2. Ability to force users to select a time (no option for 'no expire')
Nice ideas. When I'll be working on next 1.2.x version I'll take a closer look at these functions.
Post Expire - set when your post/topic will disappear/be locked/moved.
GG & Tlen & Skype - for polish instant messangers.

Locked

Return to “[3.0.x] MOD Database Releases”

Who is online

Users browsing this forum: No registered users and 14 guests