Quote:
Originally Posted by xtremeoff-road
No my friend, I am looking for the code to add to my CMPS moderation module so that I do not have to go into the admincp every time to check if new quotes have ben submitted.
|
I know, it's in that post I linked along with instructions for adding the Random Quote block.
To add a message for after a quote is submitted, create a template called quote_message (just base it off of quote_addquote and delete the text boxes) then, in quotes.php find
PHP Code:
elseif ($_REQUEST['do'] == 'add') {
if (!$vbulletin->userinfo['userid']) {
print_no_permission();
exit;
}
if (empty($_POST['author']) OR empty($_POST['quote'])) {
eval(standard_error(fetch_error('requiredfields')));
}
$approved = 0;
if ($settings[3] == 0) {
$approved = 1;
}
if ($settings[5] == 1) {
$context = $db->escape_string(htmlspecialchars_uni(trim($_POST['context'])));
}
$author = $db->escape_string(htmlspecialchars_uni(trim($_POST['author'])));
$quote = $db->escape_string(nl2br(htmlspecialchars_uni(trim($_POST['quote']))));
$db->query_write('
INSERT INTO ' . TABLE_PREFIX . 'quotes
(quote, author, userid, approved, context) VALUES
("' . $quote . '", "' . $author . '", ' . $vbulletin->userinfo['userid'] . ', ' . $approved . ', "' . $context . '")
');
header('Location: ' . $vbulletin->options['forumhome'] . '.php?' . $vbulletin->session->vars['sessionurl']);
}
and replace that with
PHP Code:
elseif ($_REQUEST['do'] == 'add') {
if (!$vbulletin->userinfo['userid']) {
print_no_permission();
exit;
}
if (empty($_POST['author']) OR empty($_POST['quote'])) {
eval(standard_error(fetch_error('requiredfields')));
}
$approved = 0;
if ($settings[3] == 0) {
$approved = 1;
}
if ($settings[5] == 1) {
$context = $db->escape_string(htmlspecialchars_uni(trim($_POST['context'])));
}
$author = $db->escape_string(htmlspecialchars_uni(trim($_POST['author'])));
$quote = $db->escape_string(nl2br(htmlspecialchars_uni(trim($_POST['quote']))));
$db->query_write('
INSERT INTO ' . TABLE_PREFIX . 'quotes
(quote, author, userid, approved, context) VALUES
("' . $quote . '", "' . $author . '", ' . $vbulletin->userinfo['userid'] . ', ' . $approved . ', "' . $context . '")
');
eval('print_output("' . fetch_template('quote_message') . '");');
}
I know about the missing phrase, I've yet to figure out what group to put it in. :ermm:
Quote:
Originally Posted by samu2
is there any way I can get it to show up on all pages?
|
Instructions are in
this post.