News:

Wondering if this will always be free?  See why free is better.

Main Menu

[MOD-RC2] Topic Descriptions

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

Previous topic - Next topic

kezayah

Where is the full mod please ???
I search but I found it ... :(
It runs to 1.1RC ???
Sorry for my english, I'm french !!! :)

!Hachi!

hey kirby can you please reupload for 1.0.5?
                      please make it if possible for you
Happy Ramadan

Kirby

I could have sworn I added it to the mod site, I'll look :)

EDIT: I don't think I have this anymore :(

kezayah


!Hachi!

arggggggggg please anyone........really need this
Happy Ramadan

Kirby

I found this, but I haven't looked at it all. You may need to alter the code.

kezayah

thanks 1000 times !!!

post.php is very very different !!!  :o :o :o

ArkServer

Can anyone make this for 1.1rc1? i need this for our forum.
thanks in advance

mrselnombre

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

Vinspire^

Is there any preview for this mod ?

kezayah




Vinspire

So, this mod doesnt exist ha ?

mrselnombre

#54
Hmmm got the code in.. with a bit of fiddling

it appears to not be adding the description to the database.
(\__/)
(='.'=)This is Bunny. Copy and paste bunny into your
(")_(")signature to help him gain world domination.
Total Twaddle.

kezayah

I find !!!  :D (but there is few errors maybe  :-[)

Fichier : Subs-Post.php:

Rechercher :
// Insert the post.
db_query("
INSERT INTO {$db_prefix}messages
(ID_BOARD, ID_TOPIC, ID_MEMBER, subject, body, posterName, posterEmail, posterTime,


Remplacer par :
// Insert the post.
db_query("
INSERT INTO {$db_prefix}messages
(ID_BOARD, ID_TOPIC, ID_MEMBER, subject, description, body, posterName, posterEmail, posterTime,


Rechercher juste après :
VALUES ($topicOptions[board], $topicOptions[id], $posterOptions[id], SUBSTRING('$msgOptions[subject]', 1, 255), SUBSTRING('$msgOptions[body]', 1, 65534), SUBSTRING('$posterOptions[name]', 1, 255), SUBSTRING('$posterOptions[email]', 1, 255), " . time() . ",

Remplacer par :
VALUES ($topicOptions[board], $topicOptions[id], $posterOptions[id], SUBSTRING('$msgOptions[subject]', 1, 255), SUBSTRING('$msgOptions[description]', 1, 255), SUBSTRING('$msgOptions[body]', 1, 65534), SUBSTRING('$posterOptions[name]', 1, 255), SUBSTRING('$posterOptions[email]', 1, 255), " . time() . ",

kezayah

Fichier : MessageIndex.php

Rechercher :

mf.subject AS firstSubject, mf.icon AS firstIcon, mf.posterName AS firstMemberName,

Remplacer par :
mf.subject AS firstSubject, mf.description AS description, mf.icon AS firstIcon, mf.posterName AS firstMemberName,

Rechercher plus loin :
// 'Print' the topic info.
$context['topics'][$row['ID_TOPIC']] = array(
'id' => $row['ID_TOPIC'],
'first_post' => array(
'id' => $row['ID_FIRST_MSG'],
'member' => array(
'username' => $row['firstMemberName'],
'name' => $row['firstDisplayName'],
'id' => $row['firstID_MEMBER'],
'href' => !empty($row['firstID_MEMBER']) ? $scripturl . '?action=profile;u=' . $row['firstID_MEMBER'] : '',
'link' => !empty($row['firstID_MEMBER']) ? '<a href="' . $scripturl . '?action=profile;u=' . $row['firstID_MEMBER'] . '" title="' . $txt[92] . ' ' . $row['firstDisplayName'] . '">' . $row['firstDisplayName'] . '</a>' : $row['firstDisplayName']
),
'time' => timeformat($row['firstPosterTime']),
'timestamp' => forum_time(true, $row['firstPosterTime']),
'subject' => $row['firstSubject'],

Ajouter après :

'description' => $row['description'],

Rechercher juste après :
'is_posted_in' => false,
'icon' => $row['firstIcon'],
'icon_url' => $settings[$context['icon_sources'][$row['firstIcon']]] . '/post/' . $row['firstIcon'] . '.gif',
'subject' => $row['firstSubject'],

Ajouter après :
'description' => $row['description'],

kezayah

Fichier : Display.php

Rechercher :
// Get all the important topic info.
$request = db_query("
SELECT
t.numReplies, t.numViews, t.locked, ms.subject, t.isSticky, t.ID_POLL,

Remplacer par :
// Get all the important topic info.
$request = db_query("
SELECT
t.numReplies, t.numViews, t.locked, ms.subject, ms.description, t.isSticky, t.ID_POLL,


Rechercher plus loin :
// Set the topic's information for the template.
$context['subject'] = $topicinfo['subject'];
$context['num_views'] = $topicinfo['numViews'];


Ajouter après :
$context['description'] = $topicinfo['description'];

kezayah

Fichier : Post.php

Rechercher :
if (!empty($topic))
{
$request = db_query("
SELECT
t.locked, IFNULL(ln.ID_TOPIC, 0) AS notify, t.isSticky, t.ID_POLL, t.numReplies, mf.ID_MEMBER,
t.ID_FIRST_MSG, mf.subject, GREATEST(ml.posterTime, ml.modifiedTime) AS lastPostTime


Remplacer par :
if (!empty($topic))
{
$request = db_query("
SELECT
t.locked, IFNULL(ln.ID_TOPIC, 0) AS notify, t.isSticky, t.ID_POLL, t.numReplies, mf.ID_MEMBER,
t.ID_FIRST_MSG, mf.subject, mf.description, GREATEST(ml.posterTime, ml.modifiedTime) AS lastPostTime


Rechercher juste après :
WHERE t.ID_TOPIC = $topic
LIMIT 1", __FILE__, __LINE__);
list ($locked, $context['notify'], $sticky, $pollID, $context['num_replies'], $ID_MEMBER_POSTER, $ID_FIRST_MSG, $first_subject, $lastPostTime) = mysql_fetch_row($request);
mysql_free_result($request);

Remplacer par :
WHERE t.ID_TOPIC = $topic
LIMIT 1", __FILE__, __LINE__);
list ($locked, $context['notify'], $sticky, $pollID, $context['num_replies'], $ID_MEMBER_POSTER, $ID_FIRST_MSG, $first_subject, $first_description, $lastPostTime) = mysql_fetch_row($request);
mysql_free_result($request);


Rechercher :

else
{
if (!isset($_REQUEST['subject']))
$_REQUEST['subject'] = '';
if (!isset($_REQUEST['message']))
$_REQUEST['message'] = '';
if (!isset($_REQUEST['icon']))
$_REQUEST['icon'] = 'xx';

$really_previewing = false;
}

// Set up the inputs for the form.
$form_subject = strtr(htmlspecialchars(stripslashes($_REQUEST['subject'])), array("\r" => '', "\n" => '', "\t" => ''));
$form_message = htmlspecialchars(stripslashes($_REQUEST['message']), ENT_QUOTES);

// Cheating ;).
$form_subject = preg_replace('~&amp;#(\d{4,5}|[2-9]\d{2,4}|1[2-9]\d);~', '&#$1;', $form_subject);

// Make sure the subject isn't too long - taking into account special characters.
$strlen_subject = preg_replace('~&(#\d{4,5}|#[3-9]\d{2,4}|#2[6-9]\d|quot|#039|amp|lt|gt);~', '_', $form_subject);
// Clip off the excess characters (100 - 104 is negative) - hopefully roughly making it as long as need be.
if (strlen($strlen_subject) > 100)
$form_subject = substr($form_subject, 0, 100 - strlen($strlen_subject));

// Have we inadvertently trimmed off the subject of useful information?
if (strlen(htmltrim__recursive($strlen_subject)) == 0)
$context['post_error']['no_subject'] = true;


Remplacer par :

else
{
if (!isset($_REQUEST['subject']))
$_REQUEST['subject'] = '';
if (!isset($_REQUEST['description']))
$_REQUEST['description'] = '';
if (!isset($_REQUEST['message']))
$_REQUEST['message'] = '';
if (!isset($_REQUEST['icon']))
$_REQUEST['icon'] = 'xx';

$really_previewing = false;
}

// Set up the inputs for the form.
$form_subject = strtr(htmlspecialchars(stripslashes($_REQUEST['subject'])), array("\r" => '', "\n" => '', "\t" => ''));
$form_description = strtr(htmlspecialchars(stripslashes($_REQUEST['description'])), array("\r" => '', "\n" => '', "\t" => ''));
$form_message = htmlspecialchars(stripslashes($_REQUEST['message']), ENT_QUOTES);

// Cheating ;).
$form_subject = preg_replace('~&amp;#(\d{4,5}|[2-9]\d{2,4}|1[2-9]\d);~', '&#$1;', $form_subject);
$form_description = preg_replace('~&amp;#(\d{4,5}|[2-9]\d{2,4}|1[2-9]\d);~', '&#$1;', $form_description);

// Make sure the subject isn't too long - taking into account special characters.
$strlen_subject = preg_replace('~&(#\d{4,5}|#[3-9]\d{2,4}|#2[6-9]\d|quot|#039|amp|lt|gt);~', '_', $form_subject);
// Clip off the excess characters (100 - 104 is negative) - hopefully roughly making it as long as need be.
if (strlen($strlen_subject) > 100)
$form_subject = substr($form_subject, 0, 100 - strlen($strlen_subject));

// Make sure the description isn't too long - taking into account special characters.
$strlen_description = preg_replace('~&(#\d{4,5}|#[3-9]\d{2,4}|#2[6-9]\d|quot|#039|amp|lt|gt);~', '_', $form_description);
// Clip off the excess characters (100 - 104 is negative) - hopefully roughly making it as long as need be.
if (strlen($strlen_description) > 100)
$form_description = substr($form_description, 0, 100 - strlen($strlen_description));

// Have we inadvertently trimmed off the subject of useful information?
if (strlen(htmltrim__recursive($strlen_subject)) == 0)
$context['post_error']['no_subject'] = true;


Rechercher :
if ($form_subject != '')
{
$context['preview_subject'] = $form_subject;

censorText($context['preview_subject']);
censorText($context['preview_message']);
}


Remplacer par :
if ($form_subject != '')
{
$context['preview_subject'] = $form_subject;

censorText($context['preview_subject']);
censorText($context['preview_description']);
censorText($context['preview_message']);
}


Rechercher :
// Get the existing message.
$request = db_query("
SELECT
m.ID_MEMBER, m.modifiedTime, m.smileysEnabled, m.body,
m.posterName, m.posterEmail, m.subject, m.icon,


Remplacer par :
// Get the existing message.
$request = db_query("
SELECT
m.ID_MEMBER, m.modifiedTime, m.smileysEnabled, m.body,
m.posterName, m.posterEmail, m.subject, m.description, m.icon,


Rechercher :
// Get the stuff ready for the form.
$form_subject = $row['subject'];
$form_message = un_preparsecode($row['body']);
censorText($form_message);
censorText($form_subject);


Remplacer par :
// Get the stuff ready for the form.
$form_subject = $row['subject'];
$form_description = $row['description'];
$form_message = un_preparsecode($row['body']);
censorText($form_message);
censorText($form_description);
censorText($form_subject);


Rechercher :
$context['subject'] = addcslashes($form_subject, '"');
$context['message'] = str_replace(array('"', '<', '>', '  '), array('&quot;', '&lt;', '&gt;', ' &nbsp;'), $form_message);
$context['attached'] = '';
$context['allowed_extensions'] = strtr($modSettings['attachmentExtensions'], array(',' => ', '));
$context['make_poll'] = isset($_REQUEST['poll']);


Remplacer par :
$context['subject'] = addcslashes($form_subject, '"');
$context['description'] = addcslashes($form_description, '"');
$context['message'] = str_replace(array('"', '<', '>', '  '), array('&quot;', '&lt;', '&gt;', ' &nbsp;'), $form_message);
$context['attached'] = '';
$context['allowed_extensions'] = strtr($modSettings['attachmentExtensions'], array(',' => ', '));
$context['make_poll'] = isset($_REQUEST['poll']);


Rechercher :
// Add special html entities to the subject, message, name, and email.
$_POST['message'] = htmlspecialchars($_POST['message'], ENT_QUOTES);
$_POST['subject'] = strtr(htmlspecialchars($_POST['subject']), array("\r" => '', "\n" => '', "\t" => ''));
$_POST['guestname'] = htmlspecialchars($_POST['guestname']);
$_POST['email'] = htmlspecialchars($_POST['email']);


Remplacer par :
// Add special html entities to the subject, message, name, and email.
$_POST['message'] = htmlspecialchars($_POST['message'], ENT_QUOTES);
$_POST['subject'] = strtr(htmlspecialchars($_POST['subject']), array("\r" => '', "\n" => '', "\t" => ''));
$_POST['description'] = strtr(htmlspecialchars($_POST['description']), array("\r" => '', "\n" => '', "\t" => ''));
$_POST['guestname'] = htmlspecialchars($_POST['guestname']);
$_POST['email'] = htmlspecialchars($_POST['email']);


Rechercher :
// Cheat and fix entities in the subject line.
$_POST['subject'] = preg_replace('~&amp;#(\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('~&amp;#(\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('~&amp;#(\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)));

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

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


Rechercher :
// Collect all parameters for the creation or modification of a post.
$msgOptions = array(
'id' => empty($_REQUEST['msg']) ? 0 : (int) $_REQUEST['msg'],
'subject' => $_POST['subject'],
'body' => $_POST['message'],
'icon' => preg_replace('~[\./\\\\*:"<>]~', '', $_POST['icon']),
'smileys_enabled' => !isset($_POST['ns']),
'attachments' => empty($attachIDs) ? array() : $attachIDs,
'hiddenOption' => (empty($_POST['hiddenOption']) ? 0 : $_POST['hiddenOption']),
'hiddenValue' => (empty($_POST['hiddenValue']) ? 0 : $_POST['hiddenValue']),
);


Remplacer par :
// Collect all parameters for the creation or modification of a post.
$msgOptions = array(
'id' => empty($_REQUEST['msg']) ? 0 : (int) $_REQUEST['msg'],
'subject' => $_POST['subject'],
'description' => $_POST['description'],
'body' => $_POST['message'],
'icon' => preg_replace('~[\./\\\\*:"<>]~', '', $_POST['icon']),
'smileys_enabled' => !isset($_POST['ns']),
'attachments' => empty($attachIDs) ? array() : $attachIDs,
'hiddenOption' => (empty($_POST['hiddenOption']) ? 0 : $_POST['hiddenOption']),
'hiddenValue' => (empty($_POST['hiddenValue']) ? 0 : $_POST['hiddenValue']),
);


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]',


kezayah

MessageIndex.template.php :

Rechercher quelque part : if ($topic['pages'])

Ajouter avant :
if ($topic['description'])
echo '<br /><small>', $topic['description'], '</small>';


Display.template.php

Rechercher quelque part :          ', $context['subject'], ' &nbsp;(', $txt[641], ' ', $context['num_views'], ' ', $txt[642], ')
Ajouter après :
<br />', $context['description'], '

Post.template.php

Rechercher quelque chose qui ressemble à ça :
<tr>
<td colspan="2"><legend>&nbsp;<b', isset($context['post_error']['no_subject']) ? ' style="color: #FF0000;"' : '', '>', $txt[70], ': / ', $txt[71], '</b>&nbsp;</legend>
<input type="text" name="subject"', $context['subject'] == '' ? '' : ' value="' . $context['subject'] . '"', ' size="90" maxlength="80" tabindex="1" />';
//Ajout ptp9
   if (isset($context['topicSolved']))
   {
      echo'
         <input type="hidden" name="icon" value="' . $context['icon'] . '" />';
   }
   else
   {
      echo'
<select name="icon" id="icon" onchange="showimage()">';

// Loop through each message icon allowed, adding it to the drop down list.
foreach ($context['icons'] as $icon)
echo '
<option value="', $icon['value'], '"', $icon['value'] == $context['icon'] ? ' selected="selected"' : '', '>', $icon['name'], '</option>';

echo '
</select>
<img src="', $context['icon_url'], '" name="icons" hspace="15" alt="" />';
      }
echo '
</td>
</tr>';

Ajouter après :
if($context['is_first_post'])
{
echo '
<tr>
<td colspan="2">
<legend>&nbsp;<b>', 'Sous-titre', ':</b>&nbsp;</legend>
<input type="text" name="description"', $context['description'] == '' ? '' : ' value="' . $context['description'] . '"', ' size="90" maxlength="150" tabindex="1" />
</td>
</tr>';
}

Advertisement: