News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

[MOD-RC2] Topic Descriptions

Started by Kirby, October 24, 2004, 10:24:49 PM

Previous topic - Next topic

kezayah

#60
And to finish, create in MySql 'description' TEXT (ALTER TABLE `{$db_prefix}messages` ADD `description` TEXT NOT NULL FIRST)

mrselnombre

(\__/)
(='.'=)This is Bunny. Copy and paste bunny into your
(")_(")signature to help him gain world domination.
Total Twaddle.

mrselnombre

#62
it does but there is a heap of code in post.php that i just copuldn't find where to put.

Rechercher :


// Cheat and fix entities in the subject line.
$_POST['subject'] = preg_replace('~&#(\d{4,5}|[2-9]\d{2,4}|1[2-9]\d);~', '&#$1;', $_POST['subject']);

// At this point, we want to make sure the subject isn't too long.
$strlen_subject = preg_replace('~&(#\d{4,5}|#[3-9]\d{2,4}|#2[6-9]\d|quot|#039|amp|lt|gt);~', '_', stripslashes($_POST['subject']));
// We're stripping and adding the slashes to correctly trim it, and we're only taking off what's needed to make $strlen_subject 100.
if (strlen($strlen_subject) > 100)
$_POST['subject'] = addslashes(substr(stripslashes($_POST['subject']), 0, 100 - strlen($strlen_subject)));

// Hack to make it so &#324324... can't happen.
$_POST['subject'] = preg_replace('~&(#\d*)?$~', '', $_POST['subject']);


Remplacer par :


// Cheat and fix entities in the subject line.
$_POST['subject'] = preg_replace('~&#(\d{4,5}|[2-9]\d{2,4}|1[2-9]\d);~', '&#$1;', $_POST['subject']);

// Cheat and fix entities in the description line.
$_POST['description'] = preg_replace('~&#(\d{4,5}|[2-9]\d{2,4}|1[2-9]\d);~', '&#$1;', $_POST['description']);

// At this point, we want to make sure the subject isn't too long.
$strlen_subject = preg_replace('~&(#\d{4,5}|#[3-9]\d{2,4}|#2[6-9]\d|quot|#039|amp|lt|gt);~', '_', stripslashes($_POST['subject']));
// We're stripping and adding the slashes to correctly trim it, and we're only taking off what's needed to make $strlen_subject 100.
if (strlen($strlen_subject) > 100)
$_POST['subject'] = addslashes(substr(stripslashes($_POST['subject']), 0, 100 - strlen($strlen_subject)));

// At this point, we want to make sure the subject isn't too long.
$strlen_description = preg_replace('~&(#\d{4,5}|#[3-9]\d{2,4}|#2[6-9]\d|quot|#039|amp|lt|gt);~', '_', stripslashes($_POST['description']));
// We're stripping and adding the slashes to correctly trim it, and we're only taking off what's needed to make $strlen_description 100.
if (strlen($strlen_description) > 100)
$_POST['description'] = addslashes(substr(stripslashes($_POST['description']), 0, 100 - strlen($strlen_description)));



Rechercher :


elseif(!isset($_REQUEST['msg']) && !$user_info['is_admin'] && $user_info['warning'] == 2){
$idtostore = $topic == null ? -1 : $topic;
$request = db_query("
INSERT INTO {$db_prefix}postmoderation
(ID_MEMBER, ID_TOPIC, ID_BOARD, subject, posterName,


Remplacer par :


elseif(!isset($_REQUEST['msg']) && !$user_info['is_admin'] && $user_info['warning'] == 2){
$idtostore = $topic == null ? -1 : $topic;
$request = db_query("
INSERT INTO {$db_prefix}postmoderation
(ID_MEMBER, ID_TOPIC, ID_BOARD, subject, description, posterName,

Rechercher juste après :

VALUES ($ID_MEMBER, '$idtostore', '$board', '$_POST[subject]',


Remplacer par :


VALUES ($ID_MEMBER, '$idtostore', '$board', '$_POST[subject]', '$_POST[description]',




Any ideas? it appears to work o.k dispite that above code not being added...



had trouble getting it into the classic template too
(\__/)
(='.'=)This is Bunny. Copy and paste bunny into your
(")_(")signature to help him gain world domination.
Total Twaddle.

Advertisement: