vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   vB Thread Description (https://vborg.vbsupport.ru/showthread.php?t=69905)

AnhTuanCool 09-26-2004 10:00 PM

vB Thread Description
 
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 ;)

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

PHP Code:

'title' => STR

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

PHP Code:

'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 ;)

PHP Code:

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

PHP Code:

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

the comma at the end needs to be removed

the second one worked

the 3rd one

PHP Code:

INSERT INTO phrase (languageidvarnametextphrasetypeidVALUES (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

Code:

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

Quote:

Originally Posted by tomshawk
Sorry about this, maybe I am doing something wrong, but...

I run the queries and I am getting errors

the first one

PHP Code:

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

the comma at the end needs to be removed

the second one worked

the 3rd one

PHP Code:

INSERT INTO phrase (languageidvarnametextphrasetypeidVALUES (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

Code:

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

PHP Code:

thread's 

changed it to

PHP Code:

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

Code:

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

Quote:

Originally Posted by tomshawk
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
PHP Code:

thread.threadidthread.title AS threadtitlelastpostthread.forumid 

Replace with
PHP Code:

thread.threadidthread.title AS threadtitlethread.description AS threaddescriptionlastpostthread.forumid 

Enjoy :)

tomshawk 09-27-2004 11:58 PM

Quote:

Originally Posted by AnhTuanCOol
Yeah, I forgot to put in the instruction so ... sorry bro :speechless:

Open forumdisplay.php

Find
PHP Code:

thread.threadidthread.title AS threadtitlelastpostthread.forumid 

Replace with
PHP Code:

thread.threadidthread.title AS threadtitlethread.description AS threaddescriptionlastpostthread.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

Quote:

Originally Posted by AnhTuanCOol
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

Quote:

Originally Posted by AnhTuanCOol
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

Quote:

Originally Posted by Boofo
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

Quote:

Originally Posted by tomshawk
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
PHP Code:

        '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
PHP Code:

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
PHP Code:

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

PHP Code:


        $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
PHP Code:

        $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

Quote:

Originally Posted by AnhTuanCOol
Hmmm, I know what ya problem now, in postings.php there are lots
PHP Code:

        '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
PHP Code:

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
PHP Code:

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

PHP Code:


        $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
PHP Code:

        $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

Quote:

Originally Posted by AnhTuanCOol
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:
HTML Code:

<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:
HTML Code:

<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

Quote:

Originally Posted by Megareus Rex
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!


All times are GMT. The time now is 02:41 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01511 seconds
  • Memory Usage 1,915KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_code_printable
  • (2)bbcode_html_printable
  • (23)bbcode_php_printable
  • (10)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete