1
0
mirror of https://github.com/e107inc/e107.git synced 2025-07-31 20:00:37 +02:00

Comment prefs and some jquery fixes on the prefs page.

This commit is contained in:
CaMer0n
2012-06-17 10:27:09 +00:00
parent 5032fe7e84
commit e68c582e5b
6 changed files with 49 additions and 13 deletions

View File

@@ -122,7 +122,7 @@ if(e_AJAX_REQUEST) // TODO improve security
$row['user_id'] = USERID;
$row['user_name'] = USERNAME;
$row['comment_datestamp'] = time();
$row['comment_blocked'] = (vartrue($pref['comments_moderate']) ? 2 : 0);
$row['comment_blocked'] = (check_class($pref['comments_moderate']) ? 2 : 0);
$width = ($pid) ? 5 : 0;

View File

@@ -29,8 +29,8 @@ e107::getDb()->db_Mark_Time('(Header Top)');
e107::js('core', 'colorbox/jquery.colorbox-min.js', 'jquery', 2);
e107::css('core', 'colorbox/colorbox.css', 'jquery');
e107::js('core', 'fancybox/jquery.fancybox-1.3.4.js', 'jquery', 2);
e107::css('core', 'fancybox/jquery.fancybox-1.3.4.css', 'jquery');
// e107::js('core', 'fancybox/jquery.fancybox-1.3.4.js', 'jquery', 2);
// e107::css('core', 'fancybox/jquery.fancybox-1.3.4.css', 'jquery');
e107::js('core', 'jquery.elastic.js', 'jquery', 2);
e107::js('core', 'jquery-ui-timepicker-addon.js', 'jquery', 2);

View File

@@ -29,6 +29,36 @@ if(! getperms("1"))
include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_'.e_PAGE);
$e_sub_cat = 'prefs';
//FIXME temporary fix - need universal solution.
e107::js('inline',"
$(document).ready(function()
{
var hash = document.location.hash;
if(hash)
{
$('.plugin-navigation a').each(function(index) {
var ot = $(this).attr('href');
$(ot).hide();
$(this).closest('li').removeClass('active');
$(this).switchClass( 'link-active', 'link', 0 );
});
var button = '#eplug-nav-' + hash.replace('#', '') + '-prev-nav';
$(hash).show();
$(button).switchClass('link', 'link-active', 30 );
$(button).closest('li').addClass('active');
}
else
{
$('#core-prefs-main').show();
}
});
","jquery");
require_once (e_ADMIN."auth.php");
$e_userclass = e107::getUserClass();
@@ -197,7 +227,7 @@ $pref['membersonly_exceptions'] = implode("\n",$pref['membersonly_exceptions']);
$text = "
<div id='core-prefs'>
<form class='admin-menu' method='post' action='".e_SELF."'>
<fieldset id='core-prefs-main'>
<fieldset class='e-hideme' id='core-prefs-main'>
<legend>".PRFLAN_1."</legend>
<table class='adminform'>
<colgroup>
@@ -1315,10 +1345,13 @@ $text .= "
</tr>
<tr>
<td class='label'>Approve Comments: </td>
<td class='label'>Moderate Comments made by: </td>
<td class='control'>
".$frm->radio_switch('comments_moderate', $pref['comments_moderate'], LAN_YES, LAN_NO)."
<div class='field-help'>Posted comments will require approval before being visible to others</div>
".
$frm->uc_select('comments_moderate', $pref['comments_moderate'],"nobody,guest,new,bots,public,admin,main,classes").
"
<div class='field-help'>Comments will require manual approval by an admin prior to being visible to other users</div>
</td>
</tr>
<tr>

View File

@@ -25,7 +25,7 @@
<core name="comments_disabled">0</core>
<core name="comments_emoticons">0</core>
<core name="comments_icon">0</core>
<core name="comments_moderate">0</core>
<core name="comments_moderate">247</core>
<core name="comments_sort">desc</core>
<core name="compress_output">0</core>
<core name="contact_emailcopy">0</core>
@@ -64,10 +64,9 @@
<core name="e_jslib_gzip">1</core>
<core name="e_jslib_nocombine">0</core>
<core name="e_jslib_core"><![CDATA[array (
'prototype' => 'none',
'prototype-cdn' => 'none',
'jquery' => 'auto',
)]]></core>
'prototype' => 'none',
'jquery' => 'auto',
)]]></core>
<core name="e_jslib_plugin"><![CDATA[array ()]]></core>
<core name="e_jslib_theme"><![CDATA[array ()]]></core>
<core name="email_notify">0</core>
@@ -236,6 +235,7 @@ City, State, Country
<core name="user_reg">1</core>
<core name="user_reg_secureveri">1</core>
<core name="user_reg_veri">1</core>
<core name="user_new_period">3</core>
<core name="user_tracking">cookie</core>
<core name="wmessage_sc">0</core>
<core name="wysiwyg">0</core>

View File

@@ -78,6 +78,9 @@ $(document).ready(function()
// Admin Prefs Navigation
$(".plugin-navigation a").click(function () {
// alert(document.location.hash);
$(".plugin-navigation a").each(function(index) {
var ot = $(this).attr("href");
$(ot).hide();

View File

@@ -615,7 +615,7 @@ class comment
'comment_author_email' => $tp->toDB($cuser_mail),
'comment_datestamp' => $_t,
'comment_comment' => $comment,
'comment_blocked' => (vartrue($pref['comments_moderate']) ? 2 : 0),
'comment_blocked' => (check_class($pref['comments_moderate']) ? 2 : 0),
'comment_ip' => $ip,
'comment_type' => $tp->toDB($type, true),
'comment_lock' => 0 //Not locked by default