mirror of
https://github.com/e107inc/e107.git
synced 2025-01-29 10:38:08 +01:00
More forum changes, getting closer to it actually doing something
This commit is contained in:
parent
c7bd61a87f
commit
134bf3a7b5
@ -9,8 +9,8 @@
|
||||
* Forum admin functions
|
||||
*
|
||||
* $Source: /cvs_backup/e107_0.8/e107_plugins/forum/forum_admin_class.php,v $
|
||||
* $Revision: 1.6 $
|
||||
* $Date: 2008-12-05 01:30:56 $
|
||||
* $Revision: 1.7 $
|
||||
* $Date: 2008-12-05 20:28:05 $
|
||||
* $Author: mcfly_e107 $
|
||||
*
|
||||
*/
|
||||
@ -962,6 +962,7 @@ class forumAdmin
|
||||
function show_mods()
|
||||
{
|
||||
global $sql, $ns, $for, $tp;
|
||||
$e107 = e107::getInstance();
|
||||
$forumList = $for->forum_getforums('all');
|
||||
$parentList = $for->forum_getparents('list');
|
||||
$subList = $for->forum_getsubs('bysub');
|
||||
@ -981,7 +982,7 @@ class forumAdmin
|
||||
$txt .= "
|
||||
<tr>
|
||||
<td class='forumheader'>{$f['forum_name']}</td>
|
||||
<td class='forumheader'>".$e107->e_userclass->uc_dropdown("mods[{$f['forum_id']}]", $f['forum_moderators'], 'admin,classes')."</td>
|
||||
<td class='forumheader'>".$e107->user_class->uc_dropdown("mods[{$f['forum_id']}]", $f['forum_moderators'], 'admin,classes')."</td>
|
||||
</tr>
|
||||
";
|
||||
foreach($subList[$f['forum_id']] as $s)
|
||||
|
@ -11,8 +11,8 @@
|
||||
| GNU General Public License (http://gnu.org).
|
||||
|
|
||||
| $Source: /cvs_backup/e107_0.8/e107_plugins/forum/forum_class.php,v $
|
||||
| $Revision: 1.17 $
|
||||
| $Date: 2008-12-05 01:30:56 $
|
||||
| $Revision: 1.18 $
|
||||
| $Date: 2008-12-05 20:28:05 $
|
||||
| $Author: mcfly_e107 $
|
||||
+----------------------------------------------------------------------------+
|
||||
*/
|
||||
@ -120,7 +120,7 @@ class e107forum
|
||||
{
|
||||
if(isset($e107->currentUser['user_plugin_forum_views']))
|
||||
{
|
||||
$this->userViewed = explode('.', $e107->currentUser['user_plugin_forum_viewed']);
|
||||
$this->userViewed = explode('.', $e107->currentUser['user_plugin_forum_viewed']);
|
||||
}
|
||||
}
|
||||
if(is_array($this->userViewed) && in_array($threadId, $this->userViewed))
|
||||
@ -157,7 +157,7 @@ class e107forum
|
||||
$addUserPostCount = true;
|
||||
|
||||
$e107 = e107::getInstance();
|
||||
$result = $e107->sql->db_Insert('forum_post', $postInfo, true);
|
||||
$result = $e107->sql->db_Insert('forum_post', $postInfo);
|
||||
$forumInfo = array();
|
||||
|
||||
if($result && $updateThread)
|
||||
@ -185,7 +185,7 @@ class e107forum
|
||||
$threadInfo['_FIELD_TYPES']['thread_total_replies'] = 'cmd';
|
||||
// print_a($threadInfo);
|
||||
// exit;
|
||||
$result = $e107->sql->db_Update('forum_thread', $threadInfo, true);
|
||||
$result = $e107->sql->db_Update('forum_thread', $threadInfo);
|
||||
|
||||
}
|
||||
|
||||
@ -216,7 +216,7 @@ class e107forum
|
||||
}
|
||||
$forumInfo['forum_lastpost_info'] = $postInfo['post_datestamp'].'.'.$postInfo['post_thread'];
|
||||
$forumInfo['WHERE'] = 'forum_id = '.$postInfo['post_forum'];
|
||||
$result = $e107->sql->db_Update('forum', $forumInfo, true);
|
||||
$result = $e107->sql->db_Update('forum', $forumInfo);
|
||||
}
|
||||
|
||||
if($result && USER && $addUserPostCount)
|
||||
@ -235,12 +235,14 @@ class e107forum
|
||||
{
|
||||
$e107 = e107::getInstance();
|
||||
$threadInfo['_FIELD_TYPES'] = $this->fieldTypes['forum_thread'];
|
||||
if($result = $e107->sql->db_Insert('forum_thread', $threadInfo, true))
|
||||
if($newThreadId = $e107->sql->db_Insert('forum_thread', $threadInfo))
|
||||
{
|
||||
$postInfo['_FIELD_TYPES'] = $this->fieldTypes['forum_post'];
|
||||
$postInfo['post_thread'] = $result;
|
||||
$postInfo['post_thread'] = $newThreadId;
|
||||
$result = $this->postAdd($postInfo, false);
|
||||
return $newThreadId;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function threadUpdate($threadInfo, $inc)
|
||||
|
@ -11,8 +11,8 @@
|
||||
| GNU General Public License (http://gnu.org).
|
||||
|
|
||||
| $Source: /cvs_backup/e107_0.8/e107_plugins/forum/forum_post.php,v $
|
||||
| $Revision: 1.22 $
|
||||
| $Date: 2008-12-02 21:34:18 $
|
||||
| $Revision: 1.23 $
|
||||
| $Date: 2008-12-05 20:28:05 $
|
||||
| $Author: mcfly_e107 $
|
||||
+----------------------------------------------------------------------------+
|
||||
*/
|
||||
@ -34,20 +34,19 @@ $forum = new e107forum;
|
||||
|
||||
if (!e_QUERY || !isset($_REQUEST['id']))
|
||||
{
|
||||
header("Location:".$e107->url->getUrl('forum', 'forum', array('func' => 'main')));
|
||||
header('Location:'.$e107->url->getUrl('forum', 'forum', array('func' => 'main')));
|
||||
exit;
|
||||
}
|
||||
|
||||
$action = $_REQUEST['f'];
|
||||
$action = trim($_REQUEST['f']);
|
||||
$id = (int)$_REQUEST['id'];
|
||||
|
||||
|
||||
switch($action)
|
||||
{
|
||||
case 'rp':
|
||||
$threadInfo = $forum->threadGet($id, false);
|
||||
$forumId = $threadInfo['thread_forum_id'];
|
||||
var_dump($threadInfo);
|
||||
// var_dump($threadInfo);
|
||||
// if (!is_array($thread_info) || !count($thread_info))
|
||||
// {
|
||||
// $forum_info = false; // Someone fed us a dud forum id - should exist if replying
|
||||
@ -256,7 +255,7 @@ if (isset($_POST['newthread']) || isset($_POST['reply']))
|
||||
// Update forum with latest post info
|
||||
case 'rp':
|
||||
$postInfo['post_thread'] = $id;
|
||||
$result = $forum->postAdd($postInfo);
|
||||
$postResult = $forum->postAdd($postInfo);
|
||||
break;
|
||||
|
||||
|
||||
@ -268,7 +267,7 @@ if (isset($_POST['newthread']) || isset($_POST['reply']))
|
||||
$threadInfo['thread_forum_id'] = $forumId;
|
||||
$threadInfo['thread_active'] = 1;
|
||||
$threadInfo['thread_datestamp'] = $time;
|
||||
$result = $forum->threadAdd($threadInfo, $postInfo);
|
||||
$postResult = $forum->threadAdd($threadInfo, $postInfo);
|
||||
break;
|
||||
}
|
||||
|
||||
@ -280,32 +279,32 @@ if (isset($_POST['newthread']) || isset($_POST['reply']))
|
||||
// }
|
||||
// print_a($threadInfo);
|
||||
// print_a($postInfo);
|
||||
exit;
|
||||
// exit;
|
||||
|
||||
$result = $forum->postAdd($postInfo, $threadInfo);
|
||||
|
||||
$iid = $forum->thread_insert($subject, $post, $forum_id, $parent, $poster, $email_notify, $threadtype, $forum_info['forum_sub']);
|
||||
if($iid === -1)
|
||||
if($postResult === -1) //Duplicate post
|
||||
{
|
||||
require_once(HEADERF);
|
||||
$ns->tablerender("", LAN_FORUM_2);
|
||||
$ns->tablerender('', LAN_FORUM_2);
|
||||
require_once(FOOTERF);
|
||||
exit;
|
||||
}
|
||||
if (isset($_POST['reply'])) {
|
||||
$iid = $parent;
|
||||
}
|
||||
|
||||
if ($_POST['poll_title'] != "" && $_POST['poll_option'][0] != "" && $_POST['poll_option'][1] != "" && isset($_POST['newthread'])) {
|
||||
require_once(e_PLUGIN."poll/poll_class.php");
|
||||
$threadId = ($action == 'nt' ? $postResult : $id);
|
||||
|
||||
if ($action == 'nt' && varset($_POST['poll_title']) && $_POST['poll_option'][0] != '' && $_POST['poll_option'][1] != '')
|
||||
{
|
||||
require_once(e_PLUGIN.'poll/poll_class.php');
|
||||
$_POST['iid'] = $iid;
|
||||
$poll = new poll;
|
||||
$poll -> submit_poll(2);
|
||||
$poll->submit_poll(2);
|
||||
}
|
||||
|
||||
$threadLink = $e107->url->getUrl('forum', 'thread', array('func' => 'last', 'id' => $threadId));
|
||||
$forumLink = $e107->url->getUrl('forum', 'forum', array('func' => 'view', 'id' => $forumId));
|
||||
if ($pref['forum_redirect'])
|
||||
{
|
||||
redirect(e_PLUGIN."forum/forum_viewtopic.php?{$iid}.last");
|
||||
header('location:'.$threadLink);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -323,7 +322,7 @@ if (isset($_POST['newthread']) || isset($_POST['reply']))
|
||||
}
|
||||
|
||||
echo (isset($_POST['newthread']) ? $FORUMTHREADPOSTED : $FORUMREPLYPOSTED);
|
||||
$e107cache->clear("newforumposts");
|
||||
$e107cache->clear('newforumposts');
|
||||
require_once(FOOTERF);
|
||||
exit;
|
||||
}
|
||||
|
@ -111,7 +111,7 @@ if (MODERATOR && $action == "nt")
|
||||
$thread_s = (isset($_POST['threadtype']) ? $_POST['threadtype'] : $thread_info['head']['thread_s']);
|
||||
return "<br /><span class='defaulttext'>".LAN_400."<input name='threadtype' type='radio' value='0' ".(!$thread_s ? "checked='checked' " : "")." />".LAN_1." <input name='threadtype' type='radio' value='1' ".($thread_s == 1 ? "checked='checked' " : "")." />".LAN_2." <input name='threadtype' type='radio' value='2' ".($thread_s == 2 ? "checked='checked' " : "")." />".LAN_3."</span>";
|
||||
}
|
||||
return "";
|
||||
return '';
|
||||
SC_END
|
||||
|
||||
SC_BEGIN BACKLINK
|
||||
@ -122,35 +122,35 @@ SC_END
|
||||
|
||||
SC_BEGIN EMAILNOTIFY
|
||||
global $pref, $thread_info, $action;
|
||||
if ($pref['email_notify'] && $action == "nt" && USER)
|
||||
if ($pref['email_notify'] && $action == 'nt' && USER)
|
||||
{
|
||||
if(isset($_POST['fpreview']))
|
||||
{
|
||||
$chk = ($_POST['email_notify'] ? "checked = 'checked'" : "");
|
||||
$chk = ($_POST['email_notify'] ? "checked = 'checked'" : '');
|
||||
}
|
||||
else
|
||||
{
|
||||
if(isset($thread_info))
|
||||
{
|
||||
$chk = ($thread_info['head']['thread_active'] == 99 ? "checked='checked'" : "");
|
||||
$chk = ($thread_info['head']['thread_active'] == 99 ? "checked='checked'" : '');
|
||||
}
|
||||
else
|
||||
{
|
||||
$chk = ($pref['email_notify_on'] ? "checked='checked'" : "");
|
||||
$chk = ($pref['email_notify_on'] ? "checked='checked'" : '');
|
||||
}
|
||||
}
|
||||
return "<span class='defaulttext'>".LAN_380."</span><input type='checkbox' name='email_notify' value='1' {$chk} />";
|
||||
return "<br /><input type='checkbox' name='email_notify' value='1' {$chk} /> <span class='defaulttext'>".LAN_380."</span>";
|
||||
}
|
||||
return "";
|
||||
return '';
|
||||
SC_END
|
||||
|
||||
SC_BEGIN POLL
|
||||
global $poll_form, $action, $pref;
|
||||
if ($action == "nt" && $pref['forum_poll'] && strpos(e_QUERY, "edit") === FALSE)
|
||||
if ($action == 'nt' && $pref['forum_poll'] && strpos(e_QUERY, 'edit') === false)
|
||||
{
|
||||
return $poll_form;
|
||||
}
|
||||
return "";
|
||||
return '';
|
||||
SC_END
|
||||
|
||||
*/
|
||||
|
@ -12,8 +12,8 @@
|
||||
| GNU General Public License (http://gnu.org).
|
||||
|
|
||||
| $Source: /cvs_backup/e107_0.8/e107_plugins/forum/forum_viewtopic.php,v $
|
||||
| $Revision: 1.6 $
|
||||
| $Date: 2008-12-04 21:36:09 $
|
||||
| $Revision: 1.7 $
|
||||
| $Date: 2008-12-05 20:28:05 $
|
||||
| $Author: mcfly_e107 $
|
||||
+----------------------------------------------------------------------------+
|
||||
*/
|
||||
@ -88,7 +88,7 @@ if (MODERATOR && isset($_POST['mod']))
|
||||
$thread->threadInfo = $forum->threadGet($thread->threadId);
|
||||
}
|
||||
|
||||
$postList = $forum->PostGet($thread->threadId, $thread->threadpage * $thread->perPage, $thread->perPage);
|
||||
$postList = $forum->PostGet($thread->threadId, $thread->page * $thread->perPage, $thread->perPage);
|
||||
|
||||
//var_dump($thread->threadInfo);
|
||||
require_once (HEADERF);
|
||||
|
@ -4,8 +4,8 @@
|
||||
| e107 website system - Language File.
|
||||
|
|
||||
| $Source: /cvs_backup/e107_0.8/e107_plugins/forum/languages/English/lan_forum_admin.php,v $
|
||||
| $Revision: 1.3 $
|
||||
| $Date: 2008-12-05 01:30:56 $
|
||||
| $Revision: 1.4 $
|
||||
| $Date: 2008-12-05 20:28:05 $
|
||||
| $Author: mcfly_e107 $
|
||||
+----------------------------------------------------------------------------+
|
||||
*/
|
||||
@ -74,6 +74,7 @@ define("FORLAN_62", "Forum Options");
|
||||
define("FORLAN_63", "Ranks");
|
||||
define("FORLAN_64", "Enter your levels here, if left blank generic stars will be used to denote level. Separate levels with comma. Maximum of 10 levels, lowest first.");
|
||||
define("FORLAN_65", "Forum Title");
|
||||
define('FORLAN_66', 'Not installed');
|
||||
|
||||
define("FORLAN_70", "Enable file / image attachments");
|
||||
define("FORLAN_71", "Allow users to upload file or image with their forum post,");
|
||||
|
@ -4,9 +4,9 @@
|
||||
| e107 website system - Language File.
|
||||
|
|
||||
| $Source: /cvs_backup/e107_0.8/e107_plugins/forum/languages/English/lan_forum_post.php,v $
|
||||
| $Revision: 1.2 $
|
||||
| $Date: 2007-08-11 15:11:03 $
|
||||
| $Author: e107steved $
|
||||
| $Revision: 1.3 $
|
||||
| $Date: 2008-12-05 20:28:05 $
|
||||
| $Author: mcfly_e107 $
|
||||
+----------------------------------------------------------------------------+
|
||||
*/
|
||||
define("PAGE_NAME", "Forum");
|
||||
@ -60,7 +60,7 @@ define("LAN_324", "Your message has been successfully posted.");
|
||||
define("LAN_325", "Click Here to view your message");
|
||||
define("LAN_326", "Click here to return to the forum");
|
||||
define("LAN_327", "Review");
|
||||
define("LAN_380", "If you wish to be notified by email when a reply is posted to your thread please tick the box ");
|
||||
define("LAN_380", "Enable email tracking (email sent when reply is posted)");
|
||||
define("LAN_381", "Forum reply from ");
|
||||
define("LAN_382", "Post made: ");
|
||||
define("LAN_383", "Please click the following link to view the full thread ...");
|
||||
|
@ -14,7 +14,7 @@
|
||||
*/
|
||||
|
||||
if (!defined('e107_INIT')) { exit; }
|
||||
if(!defined("USER_WIDTH")){ define("USER_WIDTH","width:95%"); }
|
||||
if(!defined('USER_WIDTH')) { define('USER_WIDTH','width:95%'); }
|
||||
|
||||
$FORUMPOLLPOSTED =
|
||||
"<table style='".USER_WIDTH."' class='fborder'>
|
||||
@ -24,8 +24,8 @@ $FORUMPOLLPOSTED =
|
||||
<td style='text-align:right; vertical-align:middle; width:20%' class='forumheader2'>".IMAGE_e." </td>
|
||||
<td style='vertical-align:middle; width:80%' class='forumheader2'>
|
||||
<br />".LAN_413."<br />
|
||||
<span class='defaulttext'><a class='forumlink' href='".e_PLUGIN."forum/forum_viewtopic.php?".$thread_id."'>".LAN_414."</a><br />
|
||||
<a class='forumlink' href='".e_PLUGIN."forum/forum_viewforum.php?".$forum_id."'>".LAN_326."</a></span><br /><br />
|
||||
<span class='defaulttext'><a class='forumlink' href='{$threadLink}'>".LAN_414."</a><br />
|
||||
<a class='forumlink' href='{$forumLink}'>".LAN_326."</a></span><br /><br />
|
||||
</td></tr></table>";
|
||||
|
||||
$FORUMTHREADPOSTED = "
|
||||
@ -36,9 +36,9 @@ $FORUMTHREADPOSTED = "
|
||||
<td style='text-align:right; vertical-align:middle; width:20%' class='forumheader2'>".IMAGE_e." </td>
|
||||
<td style='vertical-align:middle; width:80%' class='forumheader2'>
|
||||
<br />".LAN_324."<br />
|
||||
".(defined("F_MESSAGE") ? F_MESSAGE."<br />" : "")."
|
||||
<span class='defaulttext'><a href='".e_PLUGIN."forum/forum_viewtopic.php?{$iid}.last'>".LAN_325."</a><br />
|
||||
<a href='".e_PLUGIN."forum/forum_viewforum.php?".$forum_id."'>".LAN_326."</a></span><br /><br />
|
||||
".(defined('F_MESSAGE') ? F_MESSAGE.'<br />' : '')."
|
||||
<span class='defaulttext'><a href='{$threadLink}'>".LAN_325."</a><br />
|
||||
<a href='{$forumLink}'>".LAN_326."</a></span><br /><br />
|
||||
</td></tr></table>";
|
||||
|
||||
|
||||
@ -50,9 +50,9 @@ $FORUMREPLYPOSTED = "
|
||||
<td style='text-align:right; vertical-align:middle; width:20%' class='forumheader2'>".IMAGE_e." </td>
|
||||
<td style='vertical-align:middle; width:80%' class='forumheader2'>
|
||||
<br />".LAN_415."<br />
|
||||
".(defined("F_MESSAGE") ? F_MESSAGE."<br />" : "")."
|
||||
<span class='defaulttext'><a href='".e_PLUGIN."forum/forum_viewtopic.php?{$iid}.last'>".LAN_325."</a><br />
|
||||
<a href='".e_PLUGIN."forum/forum_viewforum.php?".$forum_id."'>".LAN_326."</a></span><br /><br />
|
||||
".(defined('F_MESSAGE') ? F_MESSAGE.'<br />' : '')."
|
||||
<span class='defaulttext'><a href='{$threadLink}'>".LAN_325."</a><br />
|
||||
<a href='{$forumLink}'>".LAN_326."</a></span><br /><br />
|
||||
</td></tr></table>";
|
||||
|
||||
?>
|
Loading…
x
Reference in New Issue
Block a user