mirror of
https://github.com/e107inc/e107.git
synced 2025-08-03 21:27:25 +02:00
forum work
This commit is contained in:
@@ -9,8 +9,8 @@
|
|||||||
* Forum admin functions
|
* Forum admin functions
|
||||||
*
|
*
|
||||||
* $Source: /cvs_backup/e107_0.8/e107_plugins/forum/forum_admin_class.php,v $
|
* $Source: /cvs_backup/e107_0.8/e107_plugins/forum/forum_admin_class.php,v $
|
||||||
* $Revision: 1.7 $
|
* $Revision: 1.8 $
|
||||||
* $Date: 2008-12-05 20:28:05 $
|
* $Date: 2008-12-08 02:33:34 $
|
||||||
* $Author: mcfly_e107 $
|
* $Author: mcfly_e107 $
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@@ -676,6 +676,10 @@ class forumAdmin
|
|||||||
{
|
{
|
||||||
$text .= "<br /><b>".FORLAN_139."</b>";
|
$text .= "<br /><b>".FORLAN_139."</b>";
|
||||||
}
|
}
|
||||||
|
if(!is_writable(e_PLUGIN.'forum/attachments'))
|
||||||
|
{
|
||||||
|
$text .= "<br /><b>Attachment file is not writable!</b>";
|
||||||
|
}
|
||||||
|
|
||||||
$text .= "</td>
|
$text .= "</td>
|
||||||
<td style='width:25%;text-align:center' class='forumheader3' >".($pref['forum_attach'] ? "<input type='checkbox' name='forum_attach' value='1' checked='checked' />" : "<input type='checkbox' name='forum_attach' value='1' />")."</td>
|
<td style='width:25%;text-align:center' class='forumheader3' >".($pref['forum_attach'] ? "<input type='checkbox' name='forum_attach' value='1' checked='checked' />" : "<input type='checkbox' name='forum_attach' value='1' />")."</td>
|
||||||
|
@@ -11,8 +11,8 @@
|
|||||||
| GNU General Public License (http://gnu.org).
|
| GNU General Public License (http://gnu.org).
|
||||||
|
|
|
|
||||||
| $Source: /cvs_backup/e107_0.8/e107_plugins/forum/forum_post.php,v $
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/forum/forum_post.php,v $
|
||||||
| $Revision: 1.25 $
|
| $Revision: 1.26 $
|
||||||
| $Date: 2008-12-07 04:16:38 $
|
| $Date: 2008-12-08 02:33:34 $
|
||||||
| $Author: mcfly_e107 $
|
| $Author: mcfly_e107 $
|
||||||
+----------------------------------------------------------------------------+
|
+----------------------------------------------------------------------------+
|
||||||
*/
|
*/
|
||||||
@@ -251,12 +251,14 @@ if (isset($_POST['newthread']) || isset($_POST['reply']))
|
|||||||
{
|
{
|
||||||
foreach($uploadResult as $ur)
|
foreach($uploadResult as $ur)
|
||||||
{
|
{
|
||||||
$postInfo['post_entry'] .= $ur['txt'];
|
//$postInfo['post_entry'] .= $ur['txt'];
|
||||||
$attachments[] = $ur['att'];
|
$_tmp = $ur['type'].'*'.$ur['file'];
|
||||||
|
if($ur['thumb']) { $_tmp .= '*'.$ur['thumb']; }
|
||||||
|
$attachments[] = $_tmp;
|
||||||
}
|
}
|
||||||
$postInfo['post_attachments'] = implode(',', $attachments);
|
$postInfo['post_attachments'] = implode(',', $attachments);
|
||||||
var_dump($uploadResult);
|
|
||||||
}
|
}
|
||||||
|
var_dump($uploadResult);
|
||||||
|
|
||||||
switch($action)
|
switch($action)
|
||||||
{
|
{
|
||||||
@@ -542,11 +544,15 @@ function process_upload()
|
|||||||
|
|
||||||
$postId = (int)$postId;
|
$postId = (int)$postId;
|
||||||
$ret = array();
|
$ret = array();
|
||||||
|
// var_dump($_FILES);
|
||||||
|
|
||||||
if (isset($_FILES['file_userfile']['error']))
|
if (isset($_FILES['file_userfile']['error']))
|
||||||
{
|
{
|
||||||
require_once(e_HANDLER.'upload_handler.php');
|
require_once(e_HANDLER.'upload_handler.php');
|
||||||
if ($uploaded = file_upload('/'.e_FILE.'public/', 'attachment', 'FT_'))
|
$attachmentDir = e_PLUGIN.'forum/attachments/';
|
||||||
|
$thumbDir = e_PLUGIN.'forum/attachments/thumb/';
|
||||||
|
|
||||||
|
if ($uploaded = process_uploaded_files($attachmentDir, 'attachment', ''))
|
||||||
{
|
{
|
||||||
foreach($uploaded as $upload)
|
foreach($uploaded as $upload)
|
||||||
{
|
{
|
||||||
@@ -554,58 +560,63 @@ function process_upload()
|
|||||||
{
|
{
|
||||||
$_txt = '';
|
$_txt = '';
|
||||||
$_att = '';
|
$_att = '';
|
||||||
$fpath = "{e_FILE}public/";
|
$_file = '';
|
||||||
|
$_thumb = '';
|
||||||
|
$fpath = '{e_PLUGIN}forum/attachments/';
|
||||||
if(strstr($upload['type'], 'image'))
|
if(strstr($upload['type'], 'image'))
|
||||||
{
|
{
|
||||||
|
$_type = 'img';
|
||||||
if(isset($pref['forum_maxwidth']) && $pref['forum_maxwidth'] > 0)
|
if(isset($pref['forum_maxwidth']) && $pref['forum_maxwidth'] > 0)
|
||||||
{
|
{
|
||||||
require_once(e_HANDLER.'resize_handler.php');
|
require_once(e_HANDLER.'resize_handler.php');
|
||||||
$orig_file = $upload['name'];
|
$orig_file = $upload['name'];
|
||||||
$p = strrpos($orig_file,'.');
|
$new_file = 'th_'.$orig_file;
|
||||||
$new_file = substr($orig_file, 0 , $p).'_'.substr($orig_file, $p);
|
if(resize_image($attachmentDir.$orig_file, $attachmentDir.'thumb/'.$new_file, $pref['forum_maxwidth']))
|
||||||
if(resize_image(e_FILE.'public/'.$orig_file, e_FILE.'public/'.$new_file, $pref['forum_maxwidth']))
|
|
||||||
{
|
{
|
||||||
if($pref['forum_linkimg'])
|
if($pref['forum_linkimg'])
|
||||||
{
|
{
|
||||||
$parms = image_getsize(e_FILE.'public/'.$new_file);
|
$parms = image_getsize($attachmentDir.$new_file);
|
||||||
$_txt = '[br][link='.$fpath.$orig_file."][img{$parms}]".$fpath.$new_file.'[/img][/link][br]';
|
$_txt = '[br][link='.$fpath.$orig_file."][img{$parms}]".$fpath.$new_file.'[/img][/link][br]';
|
||||||
$_att = $new_file;
|
$_file = $orig_file;
|
||||||
|
$_thumb = $new_file;
|
||||||
//show resized, link to fullsize
|
//show resized, link to fullsize
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@unlink(e_FILE.'public/'.$orig_file);
|
@unlink($attachmentDir.$orig_file);
|
||||||
//show resized
|
//show resized
|
||||||
$parms = image_getsize(e_FILE.'public/'.$new_file);
|
$parms = image_getsize($attachmentDir.$new_file);
|
||||||
$_txt = "[br][img{$parms}]".$fpath.$new_file.'[/img][br]';
|
$_txt = "[br][img{$parms}]".$fpath.$new_file.'[/img][br]';
|
||||||
$_att = $new_file;
|
$_file = $new_file;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{ //resize failed, show original
|
{ //resize failed, show original
|
||||||
$parms = image_getsize(e_FILE.'public/'.$upload['name']);
|
$parms = image_getsize($attachmentDir.$upload['name']);
|
||||||
$_txt = "[br][img{$parms}]".$fpath.$upload['name'].'[/img]';
|
$_txt = "[br][img{$parms}]".$fpath.$upload['name'].'[/img]';
|
||||||
$_att = $upload['name'];
|
$_file = $upload['name'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{ //resizing disabled, show original
|
{ //resizing disabled, show original
|
||||||
$parms = image_getsize(e_FILE.'public/'.$upload['name']);
|
$parms = image_getsize($attachmentDir.$upload['name']);
|
||||||
//resizing disabled, show original
|
//resizing disabled, show original
|
||||||
$_txt = "[br]<div class='spacer'>[img{$parms}]".$fpath.$upload['name']."[/img]</div>\n";
|
$_txt = "[br]<div class='spacer'>[img{$parms}]".$fpath.$upload['name']."[/img]</div>\n";
|
||||||
$_att = $upload['name'];
|
$_file = $upload['name'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
//upload was not an image, link to file
|
//upload was not an image, link to file
|
||||||
|
$_type = 'file';
|
||||||
$_fname = (isset($upload['rawname']) ? $upload['rawname'] : $upload['name']);
|
$_fname = (isset($upload['rawname']) ? $upload['rawname'] : $upload['name']);
|
||||||
$_txt = '[br][file='.$fpath.$upload['name'].']'.$_fname.'[/file]';
|
$_txt = '[br][file='.$fpath.$upload['name'].']'.$_fname.'[/file]';
|
||||||
$_att = $upload['name'];
|
$_file = $upload['name'];
|
||||||
|
$_thumb = $_fname;
|
||||||
}
|
}
|
||||||
if($_txt && $_att)
|
if($_txt && $_file)
|
||||||
{
|
{
|
||||||
$ret[] = array('txt' => $_txt, 'att' => $_att);
|
$ret[] = array('type' => $_type, 'txt' => $_txt, 'file' => $_file, 'thumb' => $_thumb);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@@ -27,11 +27,39 @@ $e107 = e107::getInstance();
|
|||||||
return $e107->tp->toHTML($postInfo['post_entry'], true, 'USER_BODY', 'class:'.$post_info['user_class']);
|
return $e107->tp->toHTML($postInfo['post_entry'], true, 'USER_BODY', 'class:'.$post_info['user_class']);
|
||||||
SC_END
|
SC_END
|
||||||
|
|
||||||
SC_BEGIN PRIVMESSAGE
|
SC_BEGIN ATTACHMENTS
|
||||||
global $pref, $post_info, $tp;
|
global $postInfo;
|
||||||
if(isset($pref['plug_installed']['pm']) && ($post_info['user_id'] > 0))
|
$e107 = e107::getInstance();
|
||||||
|
if($postInfo['post_attachments'])
|
||||||
{
|
{
|
||||||
return $tp->parseTemplate("{SENDPM={$post_info['user_id']}}");
|
$attachments = explode(',', $postInfo['post_attachments']);
|
||||||
|
$txt = '';
|
||||||
|
foreach($attachments as $a)
|
||||||
|
{
|
||||||
|
$info = explode('*', $a);
|
||||||
|
switch($info[0])
|
||||||
|
{
|
||||||
|
case 'file':
|
||||||
|
$txt .= IMAGE_attachment." <a href='".e_PLUGIN_ABS."forum/attachments/{$info[1]}'>{$info[2]}</a><br />";
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'img':
|
||||||
|
//if image has a thumb, show it and link to main
|
||||||
|
if(isset($info[2]))
|
||||||
|
{
|
||||||
|
$txt .= "<a href='".e_PLUGIN_ABS."forum/attachments/{$info[1]}'><img src='".e_PLUGIN_ABS."forum/attachments/thumb/{$info[2]}' alt='' /></a>";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $txt;
|
||||||
|
}
|
||||||
|
SC_END
|
||||||
|
|
||||||
|
SC_BEGIN PRIVMESSAGE
|
||||||
|
global $postInfo, $tp;
|
||||||
|
if(plugInstalled('pm') && ($postInfo['post_user'] > 0))
|
||||||
|
{
|
||||||
|
return $tp->parseTemplate("{SENDPM={$postInfo['post_user']}}");
|
||||||
}
|
}
|
||||||
SC_END
|
SC_END
|
||||||
|
|
||||||
@@ -99,18 +127,18 @@ return '';
|
|||||||
SC_END
|
SC_END
|
||||||
|
|
||||||
SC_BEGIN EMAILITEM
|
SC_BEGIN EMAILITEM
|
||||||
global $post_info, $tp;
|
global $postInfo, $tp;
|
||||||
if($post_info['thread_parent'] == 0)
|
if($postInfo['thread_start'])
|
||||||
{
|
{
|
||||||
return $tp->parseTemplate("{EMAIL_ITEM=".FORLAN_101."^plugin:forum.{$post_info['thread_id']}}");
|
return $tp->parseTemplate("{EMAIL_ITEM=".FORLAN_101."^plugin:forum.{$postInfo['post_thread']}}");
|
||||||
}
|
}
|
||||||
SC_END
|
SC_END
|
||||||
|
|
||||||
SC_BEGIN PRINTITEM
|
SC_BEGIN PRINTITEM
|
||||||
global $post_info, $tp;
|
global $postInfo, $tp;
|
||||||
if($post_info['thread_parent'] == 0)
|
if($postInfo['thread_start'])
|
||||||
{
|
{
|
||||||
return $tp->parseTemplate("{PRINT_ITEM=".FORLAN_102."^plugin:forum.{$post_info['thread_id']}}");
|
return $tp->parseTemplate("{PRINT_ITEM=".FORLAN_102."^plugin:forum.{$postInfo['post_thread']}}");
|
||||||
}
|
}
|
||||||
SC_END
|
SC_END
|
||||||
|
|
||||||
@@ -130,11 +158,10 @@ return ($postInfo['user_signature'] ? "<br /><hr style='width:15%; text-align:le
|
|||||||
SC_END
|
SC_END
|
||||||
|
|
||||||
SC_BEGIN PROFILEIMG
|
SC_BEGIN PROFILEIMG
|
||||||
global $post_info, $tp;
|
global $postInfo, $tp;
|
||||||
if (USER && $post_info['user_id']) {
|
if (USER && $postInfo['user_name'])
|
||||||
return $tp->parseTemplate("{PROFILE={$post_info['user_id']}}");
|
{
|
||||||
} else {
|
return $tp->parseTemplate("{PROFILE={$postInfo['post_user']}}");
|
||||||
return "";
|
|
||||||
}
|
}
|
||||||
SC_END
|
SC_END
|
||||||
|
|
||||||
@@ -147,9 +174,10 @@ if ($postInfo['post_user'])
|
|||||||
SC_END
|
SC_END
|
||||||
|
|
||||||
SC_BEGIN VISITS
|
SC_BEGIN VISITS
|
||||||
global $post_info;
|
global $postInfo;
|
||||||
if ($post_info['user_id']) {
|
if ($postInfo['user_name'])
|
||||||
return LAN_09.": ".$post_info['user_visits']."<br />";
|
{
|
||||||
|
return LAN_09.': '.$postInfo['user_visits'].'<br />';
|
||||||
}
|
}
|
||||||
SC_END
|
SC_END
|
||||||
|
|
||||||
@@ -163,16 +191,17 @@ if ($postInfo['user_customtitle'])
|
|||||||
SC_END
|
SC_END
|
||||||
|
|
||||||
SC_BEGIN WEBSITE
|
SC_BEGIN WEBSITE
|
||||||
global $post_info, $tp;
|
global $postInfo, $tp;
|
||||||
if ($post_info['user_homepage']) {
|
if ($postInfo['user_homepage']) {
|
||||||
return LAN_08.": ".$post_info['user_homepage']."<br />";
|
return LAN_08.': '.$postInfo['user_homepage'].'<br />';
|
||||||
}
|
}
|
||||||
SC_END
|
SC_END
|
||||||
|
|
||||||
SC_BEGIN WEBSITEIMG
|
SC_BEGIN WEBSITEIMG
|
||||||
global $post_info;
|
global $postInfo;
|
||||||
if ($post_info['user_homepage'] && $post_info['user_homepage'] != "http://") {
|
if ($postInfo['user_homepage'] && $postInfo['user_homepage'] != 'http://')
|
||||||
return "<a href='{$post_info['user_homepage']}'>".IMAGE_website."</a>";
|
{
|
||||||
|
return "<a href='{$postInfo['user_homepage']}'>".IMAGE_website.'</a>';
|
||||||
}
|
}
|
||||||
SC_END
|
SC_END
|
||||||
|
|
||||||
@@ -209,8 +238,8 @@ if (USER) {
|
|||||||
SC_END
|
SC_END
|
||||||
|
|
||||||
SC_BEGIN RPG
|
SC_BEGIN RPG
|
||||||
global $post_info;
|
global $postInfo;
|
||||||
return rpg($post_info['user_join'],$post_info['user_forums']);
|
return rpg($postInfo['user_join'],$postInfo['user_plugin_forum_posts']);
|
||||||
SC_END
|
SC_END
|
||||||
|
|
||||||
SC_BEGIN MEMBERID
|
SC_BEGIN MEMBERID
|
||||||
@@ -263,8 +292,9 @@ return $ldata[$post_info['user_id']][1];
|
|||||||
SC_END
|
SC_END
|
||||||
|
|
||||||
SC_BEGIN MODOPTIONS
|
SC_BEGIN MODOPTIONS
|
||||||
if (MODERATOR) {
|
if (MODERATOR)
|
||||||
return showmodoptions();
|
{
|
||||||
|
return showmodoptions();
|
||||||
}
|
}
|
||||||
SC_END
|
SC_END
|
||||||
|
|
||||||
@@ -274,7 +304,6 @@ if ($postInfo['post_edit_datestamp'])
|
|||||||
{
|
{
|
||||||
return $gen->convert_date($postInfo['thread_edit_datestamp'],'forum');
|
return $gen->convert_date($postInfo['thread_edit_datestamp'],'forum');
|
||||||
}
|
}
|
||||||
return '';
|
|
||||||
SC_END
|
SC_END
|
||||||
|
|
||||||
SC_BEGIN LASTEDITBY
|
SC_BEGIN LASTEDITBY
|
||||||
|
@@ -12,8 +12,8 @@
|
|||||||
| GNU General Public License (http://gnu.org).
|
| GNU General Public License (http://gnu.org).
|
||||||
|
|
|
|
||||||
| $Source: /cvs_backup/e107_0.8/e107_plugins/forum/forum_viewtopic.php,v $
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/forum/forum_viewtopic.php,v $
|
||||||
| $Revision: 1.9 $
|
| $Revision: 1.10 $
|
||||||
| $Date: 2008-12-07 04:16:38 $
|
| $Date: 2008-12-08 02:33:34 $
|
||||||
| $Author: mcfly_e107 $
|
| $Author: mcfly_e107 $
|
||||||
+----------------------------------------------------------------------------+
|
+----------------------------------------------------------------------------+
|
||||||
*/
|
*/
|
||||||
@@ -45,6 +45,13 @@ $thread = new e107ForumThread;
|
|||||||
|
|
||||||
$thread->init();
|
$thread->init();
|
||||||
|
|
||||||
|
if(isset($_POST['track_toggle']))
|
||||||
|
{
|
||||||
|
$thread->toggle_track();
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
//print_a($_POST);
|
||||||
|
|
||||||
if(isset($_GET['f']))
|
if(isset($_GET['f']))
|
||||||
{
|
{
|
||||||
$thread->processFunction();
|
$thread->processFunction();
|
||||||
@@ -92,7 +99,6 @@ if (MODERATOR && isset($_POST['mod']))
|
|||||||
$postList = $forum->PostGet($thread->threadId, $thread->page * $thread->perPage, $thread->perPage);
|
$postList = $forum->PostGet($thread->threadId, $thread->page * $thread->perPage, $thread->perPage);
|
||||||
|
|
||||||
//var_dump($thread->threadInfo);
|
//var_dump($thread->threadInfo);
|
||||||
require_once (HEADERF);
|
|
||||||
require_once (e_HANDLER . 'level_handler.php');
|
require_once (e_HANDLER . 'level_handler.php');
|
||||||
$gen = new convert;
|
$gen = new convert;
|
||||||
if ($thread->message)
|
if ($thread->message)
|
||||||
@@ -143,19 +149,25 @@ $NEXTPREV .= "<a href='" . $e107->url->getUrl('forum', 'thread', array('func' =>
|
|||||||
if ($pref['forum_track'] && USER)
|
if ($pref['forum_track'] && USER)
|
||||||
{
|
{
|
||||||
$img = ($thread->threadInfo['track_userid'] ? IMAGE_track : IMAGE_untrack);
|
$img = ($thread->threadInfo['track_userid'] ? IMAGE_track : IMAGE_untrack);
|
||||||
$url = $e107->url->getUrl('forum', 'thread', array('func' => 'track_toggle', 'id' => $thread->threadId));
|
$url = $e107->url->getUrl('forum', 'thread', array('func' => 'view', 'id' => $thread->threadId));
|
||||||
$TRACK .= "
|
$TRACK .= "
|
||||||
<span id='forum-track-trigger-container'>
|
<span id='forum-track-trigger-container'>
|
||||||
<a href='{$url}' id='forum-track-trigger'>{$img}</a>
|
<a href='{$url}' id='forum-track-trigger'>{$img}</a>
|
||||||
</span>
|
</span>
|
||||||
<script type='text/javascript'>
|
<script type='text/javascript'>
|
||||||
|
e107.runOnLoad(function(){
|
||||||
//put this in header_js or as inline script just after the markup above
|
//put this in header_js or as inline script just after the markup above
|
||||||
$('forum-track-trigger').observe('click', function(e) {
|
$('forum-track-trigger').observe('click', function(e) {
|
||||||
e.stop();
|
e.stop();
|
||||||
new e107Ajax.Updater('forum-track-trigger-container', '{$url}', {
|
new e107Ajax.Updater('forum-track-trigger-container', '{$url}', {
|
||||||
|
method: 'post',
|
||||||
|
parameters: { //send query parameters here
|
||||||
|
'track_toggle': 1
|
||||||
|
},
|
||||||
overlayPage: $(document.body)
|
overlayPage: $(document.body)
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
}, document, true);
|
||||||
</script>
|
</script>
|
||||||
";
|
";
|
||||||
}
|
}
|
||||||
@@ -206,6 +218,7 @@ foreach ($postList as $postInfo)
|
|||||||
|
|
||||||
if ($i > 1)
|
if ($i > 1)
|
||||||
{
|
{
|
||||||
|
$postInfo['thread_start'] = false;
|
||||||
$alt = !$alt;
|
$alt = !$alt;
|
||||||
if (isset($FORUMREPLYSTYLE_ALT) && $alt)
|
if (isset($FORUMREPLYSTYLE_ALT) && $alt)
|
||||||
{
|
{
|
||||||
@@ -218,6 +231,7 @@ foreach ($postList as $postInfo)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
$postInfo['thread_start'] = true;
|
||||||
$forthr = $e107->tp->parseTemplate($FORUMTHREADSTYLE, true, $forum_shortcodes) . "\n";
|
$forthr = $e107->tp->parseTemplate($FORUMTHREADSTYLE, true, $forum_shortcodes) . "\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -247,6 +261,7 @@ if ($forum->checkPerm($thread->threadInfo['thread_forum_id'], 'post') && $thread
|
|||||||
$forend = preg_replace("/\{(.*?)\}/e", '$\1', $FORUMEND);
|
$forend = preg_replace("/\{(.*?)\}/e", '$\1', $FORUMEND);
|
||||||
$forumstring = $forstr . $forthr . $forrep . $forend;
|
$forumstring = $forstr . $forthr . $forrep . $forend;
|
||||||
|
|
||||||
|
require_once (HEADERF);
|
||||||
//If last post came after USERLV and not yet marked as read, mark the thread id as read
|
//If last post came after USERLV and not yet marked as read, mark the thread id as read
|
||||||
if ($thread->threadInfo['thread_lastpost'] > USERLV && (strpos($currentUser['user_plugin_forum_viewed'], '.' . $thread->threadId . '.') === false))
|
if ($thread->threadInfo['thread_lastpost'] > USERLV && (strpos($currentUser['user_plugin_forum_viewed'], '.' . $thread->threadId . '.') === false))
|
||||||
{
|
{
|
||||||
@@ -457,6 +472,29 @@ class e107ForumThread
|
|||||||
$this->noInc = false;
|
$this->noInc = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function toggle_track()
|
||||||
|
{
|
||||||
|
global $forum, $thread;
|
||||||
|
$e107 = e107::getInstance();
|
||||||
|
if (!USER || !isset($_GET['id'])) { return; }
|
||||||
|
if($thread->threadInfo['track_userid'])
|
||||||
|
{
|
||||||
|
$forum->track('del', USERID, $_GET['id']);
|
||||||
|
$img = IMAGE_untrack;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$forum->track('add', USERID, $_GET['id']);
|
||||||
|
$img = IMAGE_track;
|
||||||
|
}
|
||||||
|
if(e_AJAX_REQUEST)
|
||||||
|
{
|
||||||
|
$url = $e107->url->getUrl('forum', 'thread', array('func' => 'view', 'id' => $thread->threadId));
|
||||||
|
echo "<a href='{$url}' id='forum-track-trigger'>{$img}</a>";
|
||||||
|
exit();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function processFunction()
|
function processFunction()
|
||||||
{
|
{
|
||||||
global $forum, $thread;
|
global $forum, $thread;
|
||||||
@@ -487,7 +525,7 @@ class e107ForumThread
|
|||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
/*
|
||||||
case 'track':
|
case 'track':
|
||||||
if (!USER || !isset($_GET['id'])) { return; }
|
if (!USER || !isset($_GET['id'])) { return; }
|
||||||
$forum->track('add', USERID, $_GET['id']);
|
$forum->track('add', USERID, $_GET['id']);
|
||||||
@@ -510,27 +548,7 @@ class e107ForumThread
|
|||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
*/
|
||||||
case 'track_toggle':
|
|
||||||
if (!USER || !isset($_GET['id'])) { return; }
|
|
||||||
if($thread->threadInfo['track_userid'])
|
|
||||||
{
|
|
||||||
$forum->track('del', USERID, $_GET['id']);
|
|
||||||
$img = IMAGE_untrack;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$forum->track('add', USERID, $_GET['id']);
|
|
||||||
$img = IMAGE_track;
|
|
||||||
}
|
|
||||||
if(e_AJAX_REQUEST)
|
|
||||||
{
|
|
||||||
$url = $e107->url->getUrl('forum', 'thread', array('func' => 'track_toggle', 'id' => $thread->threadId));
|
|
||||||
echo "<a href='{$url}' id='forum-track-trigger'>{$img}</a>";
|
|
||||||
exit();
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
|
|
||||||
case 'last':
|
case 'last':
|
||||||
// $pref['forum_postspage'] = ($pref['forum_postspage'] ? $pref['forum_postspage'] : 10);
|
// $pref['forum_postspage'] = ($pref['forum_postspage'] ? $pref['forum_postspage'] : 10);
|
||||||
|
@@ -11,8 +11,8 @@
|
|||||||
| GNU General Public License (http://gnu.org).
|
| GNU General Public License (http://gnu.org).
|
||||||
|
|
|
|
||||||
| $Source: /cvs_backup/e107_0.8/e107_plugins/forum/templates/forum_icons_template.php,v $
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/forum/templates/forum_icons_template.php,v $
|
||||||
| $Revision: 1.4 $
|
| $Revision: 1.5 $
|
||||||
| $Date: 2008-12-07 04:16:39 $
|
| $Date: 2008-12-08 02:33:34 $
|
||||||
| $Author: mcfly_e107 $
|
| $Author: mcfly_e107 $
|
||||||
+----------------------------------------------------------------------------+
|
+----------------------------------------------------------------------------+
|
||||||
*/
|
*/
|
||||||
@@ -51,6 +51,7 @@ define("IMAGE_admin_move2", "<img src='".img_path('admin_move.png')."' alt='".LA
|
|||||||
define("IMAGE_post", "<img src='".img_path('post.png')."' alt='' title='' style='border:0' />");
|
define("IMAGE_post", "<img src='".img_path('post.png')."' alt='' title='' style='border:0' />");
|
||||||
define("IMAGE_post2", "<img src='".img_path('post2.png')."' alt='' title='' style='border:0; vertical-align:bottom' />");
|
define("IMAGE_post2", "<img src='".img_path('post2.png')."' alt='' title='' style='border:0; vertical-align:bottom' />");
|
||||||
define("IMAGE_report", "<img src='".img_path('report.png')."' alt='".LAN_413."' title='".LAN_413."' style='border:0' />");
|
define("IMAGE_report", "<img src='".img_path('report.png')."' alt='".LAN_413."' title='".LAN_413."' style='border:0' />");
|
||||||
|
define("IMAGE_attachment", "<img src='".img_path('attach.png')."' alt='' title='' style='border:0' />");
|
||||||
|
|
||||||
define("IMAGE_track", "<img src='".img_path('track.png')."' alt='".LAN_392."' title='".LAN_392."' style='border:0' />");
|
define("IMAGE_track", "<img src='".img_path('track.png')."' alt='".LAN_392."' title='".LAN_392."' style='border:0' />");
|
||||||
define("IMAGE_untrack", "<img src='".img_path('untrack.png')."' alt='".LAN_391."' title='".LAN_391."' style='border:0' />");
|
define("IMAGE_untrack", "<img src='".img_path('untrack.png')."' alt='".LAN_391."' title='".LAN_391."' style='border:0' />");
|
||||||
|
@@ -11,8 +11,8 @@
|
|||||||
| GNU General Public License (http://gnu.org).
|
| GNU General Public License (http://gnu.org).
|
||||||
|
|
|
|
||||||
| $Source: /cvs_backup/e107_0.8/e107_plugins/forum/templates/forum_viewtopic_template.php,v $
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/forum/templates/forum_viewtopic_template.php,v $
|
||||||
| $Revision: 1.2 $
|
| $Revision: 1.3 $
|
||||||
| $Date: 2006-12-16 14:13:28 $
|
| $Date: 2008-12-08 02:33:34 $
|
||||||
| $Author: mcfly_e107 $
|
| $Author: mcfly_e107 $
|
||||||
+----------------------------------------------------------------------------+
|
+----------------------------------------------------------------------------+
|
||||||
*/
|
*/
|
||||||
@@ -27,6 +27,9 @@ $sc_style['LASTEDIT']['post'] = " ]</span>";
|
|||||||
$sc_style['LEVEL']['pre'] = "<div class='spacer'>";
|
$sc_style['LEVEL']['pre'] = "<div class='spacer'>";
|
||||||
$sc_style['LEVEL']['post'] = "</div>";
|
$sc_style['LEVEL']['post'] = "</div>";
|
||||||
|
|
||||||
|
$sc_style['ATTACHMENTS']['pre'] = "<div id='forum_attachments'><br />";
|
||||||
|
$sc_style['ATTACHMENTS']['post'] = "</div>";
|
||||||
|
|
||||||
$sc_style['ANON_IP']['pre'] = "<br /><div class='smalltext'>";
|
$sc_style['ANON_IP']['pre'] = "<br /><div class='smalltext'>";
|
||||||
$sc_style['ANON_IP']['post'] = "</div>";
|
$sc_style['ANON_IP']['post'] = "</div>";
|
||||||
|
|
||||||
@@ -104,7 +107,7 @@ $FORUMTHREADSTYLE = "<tr>
|
|||||||
{THREADDATESTAMP}
|
{THREADDATESTAMP}
|
||||||
</td>
|
</td>
|
||||||
<td style='text-align:right'>
|
<td style='text-align:right'>
|
||||||
{REPORTIMG}{EDITIMG}{QUOTEIMG}
|
{EMAILITEM} {PRINTITEM} {REPORTIMG}{EDITIMG}{QUOTEIMG}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
@@ -125,6 +128,7 @@ $FORUMTHREADSTYLE = "<tr>
|
|||||||
</td>
|
</td>
|
||||||
<td class='forumheader3' style='vertical-align:top'>{POLL}
|
<td class='forumheader3' style='vertical-align:top'>{POLL}
|
||||||
{POST}
|
{POST}
|
||||||
|
{ATTACHMENTS}
|
||||||
{LASTEDIT}
|
{LASTEDIT}
|
||||||
{SIGNATURE}
|
{SIGNATURE}
|
||||||
</td>
|
</td>
|
||||||
@@ -210,6 +214,7 @@ $FORUMREPLYSTYLE = "<tr>
|
|||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td class='forumheader3' style='vertical-align:top'>{POST}
|
<td class='forumheader3' style='vertical-align:top'>{POST}
|
||||||
|
{ATTACHMENTS}
|
||||||
{LASTEDIT}
|
{LASTEDIT}
|
||||||
{SIGNATURE}
|
{SIGNATURE}
|
||||||
</td>
|
</td>
|
||||||
|
Reference in New Issue
Block a user