PDA

View Full Version : vB Thread Description


AnhTuanCool
09-26-2004, 10:00 PM
vBThread Description

Version: 1.0
vBulletin Version: 3.0.3
Developed by AnhTuanCool
Install difficulty Level: Pretty long

First thing I want to say is sblum had made a hack with the purpose just like this but mine is way so different so don't yell at me though.

Brief of Description:
vBThread Description hack adds to have a description line goes along with Thread.

Feature:

Can be turned on/off
Adds description line goes under the Thread title in FORUMDISPLAY
Thread's description line is cencored, wrapped as as thread title
Thread description line goes next to the title in SHOWTHREAD at the firstpost.
Users with permission can edit this description line
Description line goes also within thread in search result
Store description line in a table(database) no extra query

Updated:
Thread description line goes next to the title in SHOWTHREAD at the firstpost.

Screenshot:
In attachments...

Install:

Attachment also

And please click install if you use this hack INSTALL (https://vborg.vbsupport.ru/vborg_miscactions.php?do=installhack&threadid=69905) ;)

If you got any problem or questions, just post it right here, I'm willing to help :)

Enjoy!

oldfan
09-27-2004, 12:18 AM
Thanks, I'll install this later.

nexialys
09-27-2004, 12:42 AM
would be even better to have description set per forum...
(ok, i have it in my own version) ... cool system thought!

tomshawk
09-27-2004, 03:30 AM
In the instructions under postings.php

you say to look for

'title' => STR,

the , is not there unless added by another hack, so it should be

'title' => STR

This looks kewl, in the process of installing as we speak.

Thanks. I'll click install once its running ;)

AnhTuanCool
09-27-2004, 03:41 AM
oh yeah, ya right tomshawk, I corrected the instruction thanks ;)

Find
####################################
'title' => STR
####################################
Replace with
####################################
'title' => STR,
'description' => STR

tomshawk
09-27-2004, 03:57 AM
Sorry about this, maybe I am doing something wrong, but...

I run the queries and I am getting errors

the first one

ALTER TABLE thread ADD description VARCHAR(250) NOT NULL DEFAULT '',

the comma at the end needs to be removed

the second one worked

the 3rd one

INSERT INTO phrase (languageid, varname, text, phrasetypeid) VALUES (0, 'setting_tdactive_desc', 'If this option set to Yes, Thread Description will be enabled and users can post, see, and edit Description for Thread. If this option set to No, users will only see thread's description only if available.', 5000)

gives this error


Error

There seems to be an error in your SQL query. The MySQL server error output below, if there is any, may also help you in diagnosing the problem

ERROR: Unclosed quote @ 304
STR: '
SQL: INSERT INTO phrase (languageid, varname, text, phrasetypeid) VALUES (0, 'setting_tdactive_desc', 'If this option set to Yes, Thread Description will be enabled and users can post, see, and edit Description for Thread. If this option set to No, users will only see thread's description only if available.', 5000)
SQL-query :

INSERT INTO phrase (languageid, varname, text, phrasetypeid) VALUES (0, 'setting_tdactive_desc', 'If this option set to Yes, Thread Description will be enabled and users can post, see, and edit Description for Thread. If this option set to No, users will only see thread's description only if available.', 5000)

MySQL said:


#1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 's description only if available.', 5000)' at line 1


the forth one worked

tomshawk
09-27-2004, 04:05 AM
Sorry about this, maybe I am doing something wrong, but...

I run the queries and I am getting errors

the first one

ALTER TABLE thread ADD description VARCHAR(250) NOT NULL DEFAULT '',

the comma at the end needs to be removed

the second one worked

the 3rd one

INSERT INTO phrase (languageid, varname, text, phrasetypeid) VALUES (0, 'setting_tdactive_desc', 'If this option set to Yes, Thread Description will be enabled and users can post, see, and edit Description for Thread. If this option set to No, users will only see thread's description only if available.', 5000)

gives this error


Error

There seems to be an error in your SQL query. The MySQL server error output below, if there is any, may also help you in diagnosing the problem

ERROR: Unclosed quote @ 304
STR: '
SQL: INSERT INTO phrase (languageid, varname, text, phrasetypeid) VALUES (0, 'setting_tdactive_desc', 'If this option set to Yes, Thread Description will be enabled and users can post, see, and edit Description for Thread. If this option set to No, users will only see thread's description only if available.', 5000)
SQL-query :

INSERT INTO phrase (languageid, varname, text, phrasetypeid) VALUES (0, 'setting_tdactive_desc', 'If this option set to Yes, Thread Description will be enabled and users can post, see, and edit Description for Thread. If this option set to No, users will only see thread's description only if available.', 5000)

MySQL said:


#1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 's description only if available.', 5000)' at line 1


the forth one worked


It didn't like

thread's

changed it to

threads

and it took

AnhTuanCool
09-27-2004, 04:06 AM
Oh, sorry, my bad, I should get an install script for those sql query cuz when I hacked it I just simply insert the data from phpmyadmin and I wrote back the SQL :D

Instuction Attachment fixed :)

tomshawk
09-27-2004, 04:27 AM
in the new thread box

All there is is a : colon

The word Description is missing

Second, after posting, in the threadview, there is no description row.

Is there is missing template?

I expect there is something to be added to showthread template, but I may be mistaken

D|ver
09-27-2004, 10:12 AM
an addition for vbadvacned cmps would be great, if the descriptions would also display in the lastest thread box

streamzone
09-27-2004, 10:37 AM
An error occurred while attempting to execute your query. The following information was returned.
error number: 1064
error desc: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'INSERT INTO phrase (languageid, varname, text, phrasetypeid) VA

great work but on execute its gives error :S

MrNase
09-27-2004, 11:47 AM
Hey, that hack looks nice. I think Iam going to install it :)

AnhTuanCool
09-27-2004, 08:17 PM
To tomshawk - add a phrase type GLOBAL var description text Description, and the description row in showthread isn't my idea but I made it and it came as an Update, check the new Instruction. Thanks ;)

To streamzone - which one you did is that, try to execute one by one. Thanks

Polo
09-27-2004, 10:03 PM
Thanks, I may find this useful...

Erwin
09-27-2004, 11:24 PM
Out of curiousity how is this different to the previously released version? :)

tomshawk
09-27-2004, 11:38 PM
The good news is I got it working, Yeah!! Thank you AnhTuanCOol

Question though, Is there a way to have it show up in the forumdisplay

Like here for example
http://www.tech-unity.com/forums/forumdisplay.php?f=38

The first post there is a test of this, but instead of the name of the thread starter, i'd like to see the description line

Ideas ;)

AnhTuanCool
09-27-2004, 11:38 PM
I've just looked through those previous released and I can tell lots different. Mine has edit thread's description as well as threadtitle, less files to be edited, can be turned on/off, Erwin. :)

AnhTuanCool
09-27-2004, 11:45 PM
The good news is I got it working, Yeah!! Thank you AnhTuanCOol

Question though, Is there a way to have it show up in the forumdisplay

Like here for example
http://www.tech-unity.com/forums/forumdisplay.php?f=38

The first post there is a test of this, but instead of the name of the thread starter, i'd like to see the description line

Ideas ;)

Yeah, I forgot to put in the instruction so ... sorry bro :speechless:

Open forumdisplay.php

Find

thread.threadid, thread.title AS threadtitle, lastpost, thread.forumid

Replace with

thread.threadid, thread.title AS threadtitle, thread.description AS threaddescription, lastpost, thread.forumid

Enjoy :)

tomshawk
09-27-2004, 11:58 PM
Yeah, I forgot to put in the instruction so ... sorry bro :speechless:

Open forumdisplay.php

Find

thread.threadid, thread.title AS threadtitle, lastpost, thread.forumid

Replace with

thread.threadid, thread.title AS threadtitle, thread.description AS threaddescription, lastpost, thread.forumid

Enjoy :)
Bingo

Thank you very much, sorry to be such a pain, but she works now ;)

AnhTuanCool
09-28-2004, 12:09 AM
No problem tomshawk, I'm glad to hear that, thank you and have fun ;)

Boofo
09-28-2004, 10:32 AM
Can descriptions be added to threads that are already there and have no description yet?

AnhTuanCool
09-28-2004, 12:11 PM
Probably Yes, just get in the thread and choose for Edit Thread ;)

Boofo
09-28-2004, 12:35 PM
Probably Yes, just get in the thread and choose for Edit Thread ;)
Then you are a better coder than I am. I did a thread description hack a while back and I had to edit postings.php a lot more than you did. ;)

AnhTuanCool
09-28-2004, 07:48 PM
You just humble Boofo, there are variety of ideas to make a hack, maybe you didn't get the right one though :)
I appreciate that

Boofo
09-28-2004, 09:41 PM
You just humble Boofo, there are variety of ideas to make a hack, maybe you didn't get the right one though :)
I appreciate that
Have you tested it to see if you can add a description on a thread that is already there?

AnhTuanCool
09-28-2004, 11:16 PM
Yes, I did.

sblum
09-29-2004, 01:06 AM
Looks good, the exact same features (except on/off option), but it is a bit cleaner than my version. I didn't include the option to turn it on/off because I figured - why would someone install it and turn it off? :P

Good job.

tomshawk
09-29-2004, 04:12 AM
Have you tested it to see if you can add a description on a thread that is already there?
I just tested it.

It gives me the box to add the description, but, when I hit save it does not show up in the post or the forumdisplay, interesting

Boofo
09-29-2004, 09:41 AM
I just tested it.

It gives me the box to add the description, but, when I hit save it does not show up in the post or the forumdisplay, interesting
I think there has to be more added to postings.php then. So the one I wrote should be right. ;)

AnhTuanCool
09-29-2004, 12:56 PM
Hmmm, I know what ya problem now, in postings.php there are lots

'title' => STR

but you must find the one goes within the Start Update Thread.

All should be right when you do this:

Open postings.php:
Find

if ($_POST['do'] == 'updatethread')
{
globalize($_POST, array(
'threadid' => INT,
'visible' => STR,
'open' => STR,
'sticky' => STR,
'iconid' => INT,
'notes' => STR_NOHTML,
'threadstatus' => INT,
'reason' => STR,
'title' => STR
));


Replace with

if ($_POST['do'] == 'updatethread')
{
globalize($_POST, array(
'threadid' => INT,
'visible' => STR,
'open' => STR,
'sticky' => STR,
'iconid' => INT,
'notes' => STR_NOHTML,
'threadstatus' => INT,
'reason' => STR,
'title' => STR,
'description' => STR
));


Find



$DB_site->query("
UPDATE " . TABLE_PREFIX . "thread SET
visible = $visible,
open = $open,
sticky = $sticky ,
title = '" . addslashes(htmlspecialchars_uni($title)) . "',
iconid = $iconid,
notes = '". addslashes($notes) ."'
$similarthreads
WHERE threadid = $threadid
");

Replace with

$DB_site->query("
UPDATE " . TABLE_PREFIX . "thread SET
visible = $visible,
open = $open,
sticky = $sticky ,
title = '" . addslashes(htmlspecialchars_uni($title)) . "',
description = '" . addslashes(htmlspecialchars_uni($description)) . "',
iconid = $iconid,
notes = '". addslashes($notes) ."'
$similarthreads
WHERE threadid = $threadid
");


there you go, and I updated the instruction too. Regard :)

reteep
09-30-2004, 12:08 PM
Great Hack, thanks!

Just one thing. The display for multiply Pages is now in the line of the Thread Description. Is it possible to set it backup to the Thread Title? (See the attachement)

AnhTuanCool
09-30-2004, 09:22 PM
Sure you can, just replace the threadbit template with mine, and you have it, enjoy :)

Megareus Rex
10-01-2004, 02:11 AM
Ok, here's my problem. I've edited and uploaded the php files, and edited the templates, and executed the SQL queries. But, NOTHING SHOWS UP!!! There's no Description box anywhere. I've double-checked all files and templates, and tried to run the queries again, which give me a duplicate table error.

What could the problem be? Usually when a hack doesn't work, there's some sort of error, but not this time...

AnhTuanCool
10-01-2004, 03:21 AM
Well, I've just re-install my test site and done this hack again and everything goes as well as I expected. One point, my hack isn't included any php file...then try to do and check the instuction again (except the sql query) if you could find any mistaken. ;)

tomshawk
10-01-2004, 03:23 AM
Hmmm, I know what ya problem now, in postings.php there are lots

'title' => STR

but you must find the one goes within the Start Update Thread.

All should be right when you do this:

Open postings.php:
Find

if ($_POST['do'] == 'updatethread')
{
globalize($_POST, array(
'threadid' => INT,
'visible' => STR,
'open' => STR,
'sticky' => STR,
'iconid' => INT,
'notes' => STR_NOHTML,
'threadstatus' => INT,
'reason' => STR,
'title' => STR
));


Replace with

if ($_POST['do'] == 'updatethread')
{
globalize($_POST, array(
'threadid' => INT,
'visible' => STR,
'open' => STR,
'sticky' => STR,
'iconid' => INT,
'notes' => STR_NOHTML,
'threadstatus' => INT,
'reason' => STR,
'title' => STR,
'description' => STR
));


Find



$DB_site->query("
UPDATE " . TABLE_PREFIX . "thread SET
visible = $visible,
open = $open,
sticky = $sticky ,
title = '" . addslashes(htmlspecialchars_uni($title)) . "',
iconid = $iconid,
notes = '". addslashes($notes) ."'
$similarthreads
WHERE threadid = $threadid
");

Replace with

$DB_site->query("
UPDATE " . TABLE_PREFIX . "thread SET
visible = $visible,
open = $open,
sticky = $sticky ,
title = '" . addslashes(htmlspecialchars_uni($title)) . "',
description = '" . addslashes(htmlspecialchars_uni($description)) . "',
iconid = $iconid,
notes = '". addslashes($notes) ."'
$similarthreads
WHERE threadid = $threadid
");


there you go, and I updated the instruction too. Regard :)


Thank you, I can edit old threads and add a description now.

Again, very kewl hack. thank you very much ;)

Megareus Rex
10-01-2004, 03:47 PM
Well, I've just re-install my test site and done this hack again and everything goes as well as I expected. One point, my hack isn't included any php file...then try to do and check the instuction again (except the sql query) if you could find any mistaken. ;)

I have checked everything again now (making it 3 times now), and it still doesn't show up. The php all works (i dont get a blank white screen), and the templates don't produce any errors. I just can't figure out what it is...

AnhTuanCool
10-01-2004, 09:28 PM
Try this,

Open template threadbit
Find:

<if condition="$show[pagenavmore]">... <a href="showthread.php?$session[sessionurl]t=$thread[threadid]&amp;goto=lastpost$thread[highlight]">$vbphrase[last_page]</a></if> )</span></if>

Add after:

<br /><font class="smallfont">$thread[threaddescription]</font>


:)

Megareus Rex
10-02-2004, 12:20 AM
Nope, the Description box STILL doesn't show up, ANYWHERE. Every single element of everything in the hack is perfectly installed, too...

Boofo
10-02-2004, 02:29 AM
Nope, the Description box STILL doesn't show up, ANYWHERE. Every single element of everything in the hack is perfectly installed, too...Try using:

$thread[description]

Surtain23
10-02-2004, 12:47 PM
Amazing hack, but it didn't work until I went to includes/functions_newpost.php and changed the $SHOWTHREADDESCRIPTION = false; to $SHOWTHREADDESCRIPTION = true;

Great work!

AnhTuanCool
10-02-2004, 12:52 PM
Oh, you know what, I make the option for you to choose for enable or disable in vB Options > Message Posting and Interface Options > Thread Description Enabled, if you changed that $SHOWTHREADDESCRIPTION = false; to $SHOWTHREADDESCRIPTION = true; then it's useless :p, try to switch between in vB Options ;)

Megareus Rex
10-02-2004, 04:50 PM
Ok, here are the new problems:

1: The thread descriptions ONLY show up in forumdisplay. They don't show up when searching for new posts.
2: The thread descriptions show up TWICE in forumdisplay. Maybe the code makes it insert twice?
3: Every single thread now has space under it, where the description WOULD be if it had one. How can I get rid of it?

AnhTuanCool
10-02-2004, 05:11 PM
All right, check these things:

Did you use the $thread[threaddescription] or $thread[description]?
Second, get in admincp vB Options > Message Posting and Interface Options to see if Thread Description is on or off.

Then fill the threadbit template with the content of the attachment below


;)

Megareus Rex
10-02-2004, 06:39 PM
I checked the vB options, and descriptions ARE turned on.

Second, I replaced threadbit with the new content, and that fixed both the double thead description problem, AND the empty space problem! :)

Now, the only remaining question: How do I get the thread descriptinos to appear on Search New Posts?

You are a great hacker, and provide excellent support. Easily some of the best I've ever received. Keep it up! :)

AnhTuanCool
10-03-2004, 01:21 AM
Oh Thank you, I'm glad to hear it :)

To get the Thread's Description goes within the Thread Title in Search Result, do these things:

Open search.php
Find:

thread.threadid, thread.threadid AS postid, thread.title AS threadtitle, thread.iconid AS threadiconid,

Replace with:

thread.threadid, thread.threadid AS postid, thread.title AS threadtitle, thread.description AS threaddescription, thread.iconid AS threadiconid,

Save it up.

Get in your admincp,
Open template search_results_postbit
Find:

$post[typeprefix] <a href="showthread.php?$session[sessionurl]t=$post[threadid]$post[highlight]"><strong>$post[threadtitle]</strong></a>

Replace with:

$post[typeprefix] <a href="showthread.php?$session[sessionurl]t=$post[threadid]$post[highlight]"><strong>$post[threadtitle]</strong></a><br /><font class="smallfont">$thread[threaddescription]</font>

Save up and you got it. Enjoy :)

Megareus Rex
10-03-2004, 07:02 PM
Thanks, it works GREAT!!!! This hack is now running perfectly for me :)

You should think about putting the Search instructions in your txt document. A lot of other board owners probably want it to work in search too.

AnhTuanCool
10-03-2004, 07:42 PM
Oh sure, I'm on it now ;) thanks

jpt62089
10-10-2004, 09:16 PM
I installed but the description box does not show...

AnhTuanCool
10-10-2004, 09:26 PM
Re-fill the threadbit template with this one https://vborg.vbsupport.ru/attachment.php?attachmentid=20952

Get in ACP > vb Options > Message Posting and Editng Options > check whether Thread Description is turned on. Good luck :)

jpt62089
10-11-2004, 09:10 PM
it is turned on and i changed the thread bit... but still no luck

AnhTuanCool
10-11-2004, 09:22 PM
When you choose for New Thread or Edit Thread, can you see the box below the Subject box with label Description?

jpt62089
10-12-2004, 03:38 PM
DANG THERE IT IS!!! it wasnt there before I SWEAR! maybe it was the schools PC's....

AnhTuanCool
10-12-2004, 07:57 PM
So now you got it ha ;)

Debbi
10-17-2004, 07:24 AM
Clicks Install. Thank you!