mirror of
https://github.com/e107inc/e107.git
synced 2025-07-31 20:00:37 +02:00
Issue #1493 : Allow tracking of topics via tracking page only (no emails). (work in progress)
This commit is contained in:
@@ -653,6 +653,9 @@ function forum_track()
|
|||||||
global $forum;
|
global $forum;
|
||||||
|
|
||||||
$trackPref = $forum->prefs->get('track');
|
$trackPref = $forum->prefs->get('track');
|
||||||
|
$trackEmailPref = $forum->prefs->get('trackemail',true);
|
||||||
|
|
||||||
|
|
||||||
if(empty($trackPref))
|
if(empty($trackPref))
|
||||||
{
|
{
|
||||||
echo "Disabled";
|
echo "Disabled";
|
||||||
@@ -691,6 +694,9 @@ function forum_track()
|
|||||||
$sql = e107::getDb();
|
$sql = e107::getDb();
|
||||||
$tp = e107::getParser();
|
$tp = e107::getParser();
|
||||||
|
|
||||||
|
$trackDiz = ($trackEmailPref) ? LAN_FORUM_3040 : LAN_FORUM_3041;
|
||||||
|
|
||||||
|
|
||||||
if($trackedThreadList = $forum->getTrackedThreadList(USERID, 'list'))
|
if($trackedThreadList = $forum->getTrackedThreadList(USERID, 'list'))
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -723,7 +729,7 @@ function forum_track()
|
|||||||
// $data['UNTRACK'] = "<a class='btn btn-default' href='".e_SELF."?untrack.".$row['thread_id']."'>".LAN_FORUM_0070."</a>";
|
// $data['UNTRACK'] = "<a class='btn btn-default' href='".e_SELF."?untrack.".$row['thread_id']."'>".LAN_FORUM_0070."</a>";
|
||||||
|
|
||||||
|
|
||||||
$data['UNTRACK'] = "<a id='".$buttonId."' href='#' title=\"".LAN_FORUM_3040."\" data-token='".e_TOKEN."' data-forum-insert='".$buttonId."' data-forum-post='".$row['thread_forum_id']."' data-forum-thread='".$row['thread_id']."' data-forum-action='track' name='track' class='btn btn-primary' >".IMAGE_track."</a>";
|
$data['UNTRACK'] = "<a id='".$buttonId."' href='#' title=\"".$trackDiz."\" data-token='".e_TOKEN."' data-forum-insert='".$buttonId."' data-forum-post='".$row['thread_forum_id']."' data-forum-thread='".$row['thread_id']."' data-forum-action='track' name='track' class='btn btn-primary' >".IMAGE_track."</a>";
|
||||||
|
|
||||||
$forum_trackstring .= $tp->simpleParse($FORUM_TRACK_MAIN, $data);
|
$forum_trackstring .= $tp->simpleParse($FORUM_TRACK_MAIN, $data);
|
||||||
}
|
}
|
||||||
|
@@ -171,14 +171,15 @@ if(!deftrue('OLD_FORUMADMIN'))
|
|||||||
|
|
||||||
protected $prefs = array(
|
protected $prefs = array(
|
||||||
'enclose' => array('title'=> FORLAN_44, 'type'=>'boolean', 'data' => 'int','help'=>FORLAN_45),
|
'enclose' => array('title'=> FORLAN_44, 'type'=>'boolean', 'data' => 'int','help'=>FORLAN_45),
|
||||||
'title' => array('title'=> FORLAN_65, 'type'=>'text', 'data' => 'str','help'=>'Help Text goes here'),
|
'title' => array('title'=> FORLAN_65, 'type'=>'text', 'data' => 'str','help'=>''),
|
||||||
'notify' => array('title'=> FORLAN_47, 'type'=>'boolean', 'data' => 'int','help'=>FORLAN_48),
|
'notify' => array('title'=> FORLAN_47, 'type'=>'boolean', 'data' => 'int','help'=>FORLAN_48),
|
||||||
'notify_on' => array('title'=> FORLAN_177, 'type'=>'boolean', 'data' => 'int','help'=>FORLAN_178),
|
'notify_on' => array('title'=> FORLAN_177, 'type'=>'boolean', 'data' => 'int','help'=>FORLAN_178),
|
||||||
'poll' => array('title'=> FORLAN_49, 'type'=>'userclass', 'data' => 'int','help'=>FORLAN_50),
|
'poll' => array('title'=> FORLAN_49, 'type'=>'userclass', 'data' => 'int','help'=>FORLAN_50),
|
||||||
'attach' => array('title'=> FORLAN_70, 'type'=>'boolean', 'data' => 'str','help'=>FORLAN_71),
|
'attach' => array('title'=> FORLAN_70, 'type'=>'boolean', 'data' => 'str','help'=>FORLAN_71),
|
||||||
'maxwidth' => array('title'=> FORLAN_134, 'type'=>'number', 'data' => 'str','help'=>FORLAN_135),
|
'maxwidth' => array('title'=> FORLAN_134, 'type'=>'number', 'data' => 'str','help'=>FORLAN_135),
|
||||||
'linkimg' => array('title'=> FORLAN_136, 'type'=>'boolean', 'data' => 'int','help'=>FORLAN_137),
|
'linkimg' => array('title'=> FORLAN_136, 'type'=>'boolean', 'data' => 'int','help'=>FORLAN_137),
|
||||||
'track' => array('title'=> FORLAN_51, 'type'=>'boolean', 'data' => 'int','help'=>FORLAN_52),
|
'track' => array('title'=> FORLAN_200, 'type'=>'boolean', 'data' => 'int','help'=>FORLAN_201),
|
||||||
|
'trackemail' => array('title'=> FORLAN_202, 'type'=>'boolean', 'data' => 'int','help'=>FORLAN_203),
|
||||||
'redirect' => array('title'=> FORLAN_112, 'type'=>'boolean', 'data' => 'int','help'=>FORLAN_113),
|
'redirect' => array('title'=> FORLAN_112, 'type'=>'boolean', 'data' => 'int','help'=>FORLAN_113),
|
||||||
'reported_post_email' => array('title'=> FORLAN_116, 'type'=>'boolean', 'data' => 'int','help'=>FORLAN_122),
|
'reported_post_email' => array('title'=> FORLAN_116, 'type'=>'boolean', 'data' => 'int','help'=>FORLAN_122),
|
||||||
'tooltip' => array('title'=> FORLAN_126, 'type'=>'boolean', 'data' => 'int','help'=>FORLAN_127),
|
'tooltip' => array('title'=> FORLAN_126, 'type'=>'boolean', 'data' => 'int','help'=>FORLAN_127),
|
||||||
|
@@ -327,6 +327,8 @@ class e107forum
|
|||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$trackByEmail = ($this->prefs->get('trackemail',true)) ? true : false;
|
||||||
|
|
||||||
$sql = e107::getDb();
|
$sql = e107::getDb();
|
||||||
|
|
||||||
if($sql->select('forum_track', '*', "track_userid=".USERID." AND track_thread=".$threadID))
|
if($sql->select('forum_track', '*', "track_userid=".USERID." AND track_thread=".$threadID))
|
||||||
@@ -334,7 +336,7 @@ class e107forum
|
|||||||
if($this->track('del', USERID, $threadID))
|
if($this->track('del', USERID, $threadID))
|
||||||
{
|
{
|
||||||
$ret['html'] = IMAGE_untrack;
|
$ret['html'] = IMAGE_untrack;
|
||||||
$ret['msg'] = LAN_FORUM_8004; // "Email notifications for this topic are now turned off. ";
|
$ret['msg'] = ($trackByEmail) ? LAN_FORUM_8004 : LAN_FORUM_8006 ; // "Email notifications for this topic are now turned off. ";
|
||||||
$ret['status'] = 'info';
|
$ret['status'] = 'info';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -348,7 +350,7 @@ class e107forum
|
|||||||
{
|
{
|
||||||
if($this->track('add', USERID, $threadID))
|
if($this->track('add', USERID, $threadID))
|
||||||
{
|
{
|
||||||
$ret['msg'] = LAN_FORUM_8003; // "Email notifications for this topic are now turned on. ";
|
$ret['msg'] = ($trackByEmail) ? LAN_FORUM_8003 : LAN_FORUM_8005; // "Email notifications for this topic are now turned on. ";
|
||||||
$ret['html'] = IMAGE_track;
|
$ret['html'] = IMAGE_track;
|
||||||
$ret['status'] = 'ok';
|
$ret['status'] = 'ok';
|
||||||
}
|
}
|
||||||
@@ -1646,8 +1648,9 @@ class e107forum
|
|||||||
$tp = e107::getParser();
|
$tp = e107::getParser();
|
||||||
|
|
||||||
$trackingPref = $this->prefs->get('track');
|
$trackingPref = $this->prefs->get('track');
|
||||||
|
$trackingEmailPref = $this->prefs->get('trackemail',true);
|
||||||
|
|
||||||
if(empty($trackingPref))
|
if(empty($trackingPref) || empty($trackingEmailPref))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@@ -305,7 +305,10 @@ if ($forum->prefs->get('track') && USER)
|
|||||||
</script>
|
</script>
|
||||||
";*/
|
";*/
|
||||||
|
|
||||||
$tVars->TRACK = "<a id='forum-track-button' href='#' title=\"".LAN_FORUM_3040."\" data-token='".deftrue('e_TOKEN','')."' data-forum-insert='forum-track-button' data-forum-post='".$thread->threadInfo['thread_forum_id']."' data-forum-thread='".$thread->threadInfo['thread_id']."' data-forum-action='track' name='track' class='e-tip btn btn-default' >".$img."</a>
|
|
||||||
|
$trackDiz = ($forum->prefs->get('trackemail',true)) ? LAN_FORUM_3040 : LAN_FORUM_3041;
|
||||||
|
|
||||||
|
$tVars->TRACK = "<a id='forum-track-button' href='#' title=\"".$trackDiz."\" data-token='".deftrue('e_TOKEN','')."' data-forum-insert='forum-track-button' data-forum-post='".$thread->threadInfo['thread_forum_id']."' data-forum-thread='".$thread->threadInfo['thread_id']."' data-forum-action='track' name='track' class='e-tip btn btn-default' >".$img."</a>
|
||||||
";
|
";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -213,4 +213,11 @@ define("FORLAN_186", "Threads per page");
|
|||||||
define("FORLAN_187", "Number of threads displayed per page");
|
define("FORLAN_187", "Number of threads displayed per page");
|
||||||
// define("FORLAN_188", "Latest Posts");
|
// define("FORLAN_188", "Latest Posts");
|
||||||
define("FORLAN_189", "Click the 'delete' button to delete the report.<br /><br />Click the 'view' button to view the topic/thread");
|
define("FORLAN_189", "Click the 'delete' button to delete the report.<br /><br />Click the 'view' button to view the topic/thread");
|
||||||
|
|
||||||
|
define("FORLAN_200", "Topic tracking");
|
||||||
|
define("FORLAN_201", "Enable this to allow your users to track topics.");
|
||||||
|
define("FORLAN_202", "Topic tracking email notifications");
|
||||||
|
define("FORLAN_203", "Enable this option to allow your users to receive email notifications when others reply to a tracked topic.");
|
||||||
|
|
||||||
|
|
||||||
?>
|
?>
|
@@ -218,6 +218,7 @@ define("LAN_FORUM_3028", "Add Poll"); // new // poll - partly in e107_plugins/po
|
|||||||
define("LAN_FORUM_3038", "Normal"); // LAN_1
|
define("LAN_FORUM_3038", "Normal"); // LAN_1
|
||||||
define("LAN_FORUM_3039", "Deactivate emoticons for this post"); // LAN_FORUMPOST_EMOTES
|
define("LAN_FORUM_3039", "Deactivate emoticons for this post"); // LAN_FORUMPOST_EMOTES
|
||||||
define("LAN_FORUM_3040", "Enable/disable email tracking (email sent when reply is posted)"); // LAN_380
|
define("LAN_FORUM_3040", "Enable/disable email tracking (email sent when reply is posted)"); // LAN_380
|
||||||
|
define("LAN_FORUM_3041", "Enable/disable tracking of this topic");
|
||||||
// missing 41-21
|
// missing 41-21
|
||||||
|
|
||||||
// forum_posted_template
|
// forum_posted_template
|
||||||
@@ -310,7 +311,8 @@ define("LAN_FORUM_8001", "A new post has been made by [x] under the topic [y] at
|
|||||||
define("LAN_FORUM_8002", "Please click the following link to view the full post ...");
|
define("LAN_FORUM_8002", "Please click the following link to view the full post ...");
|
||||||
define("LAN_FORUM_8003", "Email notifications for this topic are now turned on.");
|
define("LAN_FORUM_8003", "Email notifications for this topic are now turned on.");
|
||||||
define("LAN_FORUM_8004", "Email notifications for this topic are now turned off.");
|
define("LAN_FORUM_8004", "Email notifications for this topic are now turned off.");
|
||||||
|
define("LAN_FORUM_8005", "You are now tracking this topic.");
|
||||||
|
define("LAN_FORUM_8006", "You are no longer tracking this topic.");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user